Introduction

Remark: The code is (seems to be) in visual basic.

In my own use of Ogre Dot Net, I have noticed that there are some differences in the implementation of CEGUI versus the normal C++ implementation used with regular Ogre. I am creating this page to help people not only get the basics down, but also to provide some insight in to good design for coded GUI systems in .NET.

It all starts with setting up your GUI objects in your main project. For my project, I have my "MainWindow" class that contains my renderwindow object, and the Ogre "Root" object, etc. Whatever class you happen to have that handles all of this, is where you begin.

Setting up your GUI System

The first step in any CEGUI implementation is setting up your GUI System in the class where you have your renderwindow and "root" ogre object. This class will likely require the following Imports statements:

Imports CeguiDotNet
 Imports OgreDotNet
 Imports OgreDotNet.Cegui

You then have your declarations of your GUI objects.

Public GUI As OgreCEGUIRenderer
        Public GUISys As GuiSystem
        Public WithEvents Desktop As Window
        Public WithEvents WelcomeWindow As WelcomeWindow
        Public WithEvents OptionsWindow As OptionsWindow
        Public WithEvents GuildWindow As GuildWindow
        Public WithEvents SkillsWindow As SkillsWindow
        Public QuitQueryWindow As CloseQueryWindow
        Public CharactersWindow As CharacterWindow
        Public PAWindow As PAWindow
        Public WithEvents ChatTarget As StaticText
        Public WithEvents ChatInput As Editbox
        Public StartPosition As Single = 0.05
        Private GUIFocus As Boolean = True

As you can see, we have an "OgreCEGUIRenderer" AND a "GuiSystem" object. This confused me at first, because I didn't realize both were needed.

Next you see my declarations for my various windows. The way I designed my app, I created all of my windows at start up and then hid them all. Instead of destroying and recreating windows, I am simply using show/hide on them, since there are single instances of them all. This is with the exception of an "ErrorWindow" class, because more than one error may come up at a time. I'll go in to that later.

The "Desktop" object you see is of type "Window", which is the base window class of CEGUI (also known as DefaultWindow). I like to think of this desktop object as a transparent overlay over the entire render window. It acts as a container for all other windows.

You may notice I have a lot of custom types here. OptionsWindow as OptionsWindow for example. The reason for this is because I have defined my own custom classes for each window object, and done so with an inheritance scheme that I'll go in to later.

For now, let's focus on creating this GUI system, and setting up my "desktop".

Private Sub CreateGUI()
            Try
                GUI = New OgreCEGUIRenderer(Window)
                GUI.Initialise()
                GUI.setTargetSceneManager(Scene)

The GUI object is set up by creating a new OgreCEGUIRenderer and giving it the render window object ("Window" in this case). You then initialise it, and then send it your scene object using the setTargetSceneManager call.

GUISys = GuiSystem.CreateGuiSystemSpecial(GUI)
                Logger.Instance.setLoggingLevel(LoggingLevel.Informative)
                SchemeManager.Instance.LoadScheme("TaharezLook.scheme")
                GUISys.SetDefaultMouseCursor("TaharezLook", "MouseArrow")
                GUISys.DefaultFontName = "Tahoma-12"

The GUISystem Object (GUISys in this case), is created by the GuiSystem singleton.

Now we get in to creating our windows. The WindowManager singleton/instance is used quite a bit. (I'll show a trick later for how to make this a little easier to work with.)

Desktop = WindowManager.Instance.CreateWindow("DefaultWindow", "Desktop")
                GUISys.GUISheet = Desktop

The Desktop object is being initialized as a "DefaultWindow" type, and is being named "Desktop" in the CEGUI collection of objects. This name can later be used to look up the object by name if you would like. (Just as a personal note, I never intend to do this, and it would be great if CEGUI didn't make this naming required.) The desktop is then set to the main "GUI Sheet" in the GUI System object. This is the part that makes the desktop object that transparent overlay container for all other windows.

This same sub is continued in the next section.

Creating your windows

Continuing from the previous section, we have the same "CreateGUI" sub that began with the creation of the GUI System. Now, we are moving on to creating the various windows that lay on top of the GUISheet (Desktop). You'll notice I have it set up to create the instances of these windows through a "new" call to custom classes. I'll go in to one of these custom classes later to show how I have it all set up.

QuitQueryWindow = New CloseQueryWindow
                Desktop.AddChildWindow(QuitQueryWindow.MyWindow)
 
                WelcomeWindow = New WelcomeWindow
                Desktop.AddChildWindow(WelcomeWindow.MyWindow)
 
                CharactersWindow = New CharacterWindow
                Desktop.AddChildWindow(CharactersWindow.MyWindow)
 
                OptionsWindow = New OptionsWindow(StartPosition)
                Desktop.AddChildWindow(OptionsWindow.MyWindow)

Next, we have a static text object being created and added directly to the Desktop object. The above 4 examples are all "Frame windows" which can be moved around and such. This object looks very different, as it has no frame, and can not be moved around the desktop with the mouse.

ChatTarget = WindowManager.Instance.CreateStaticText(StaticTxt, "ChatTarget")

Notice the "StaticTxt" there. It's a string variable that I defined as a constant for "TaharezLook/StaticText". I did this for all of the CEGUI widgets, so when I change my LookAndFeel definitions, I would only have to change the string in one place for it to take effect across my entire project.

ChatTarget.SetSize(MetricsMode.Relative, New CeguiDotNet.Size(0.7, 0.2))
                ChatTarget.SetPosition(MetricsMode.Relative, New CeguiDotNet.Vector2(0, 0.8))
                ChatTarget.setAlpha(0.4)
                ChatTarget.setAlwaysOnTop(True)
                ChatTarget.setVerticalScrollbarEnabled(True)
                ChatTarget.setHorizontalScrollbarEnabled(False)
                ChatTarget.setFormatting(StaticText.HorzFormatting.WordWrapLeftAligned, StaticText.VertFormatting.BottomAligned)
                ChatTarget.SubscribeEvents()
                ChatTarget.hide()
                Desktop.AddChildWindow(ChatTarget)

As you can see, I'm defining all of my properties in code, instead of using XML. This is my own preferred method, and doesn't need to be used by everyone. If you're wanting to know how to set up your CEGUI objects with XML, see the CEGUI Wiki for help.

ChatInput = WindowManager.Instance.CreateEditbox(Editbox, "ChatInput")
                ChatInput.SetSize(MetricsMode.Relative, New CeguiDotNet.Size(0.7, 0.05))
                ChatInput.SetPosition(MetricsMode.Relative, New CeguiDotNet.Vector2(0, 0.75))
                ChatInput.setAlpha(0.4)
                ChatInput.setAlwaysOnTop(True)
                ChatInput.SubscribeEvents()
                ChatInput.deactivate()
                ChatInput.hide()
                Desktop.AddChildWindow(ChatInput)
 
                GuildWindow = New GuildWindow(StartPosition)
                Desktop.AddChildWindow(GuildWindow.MyWindow)
                UpdateStartPosition()
 
                SkillsWindow = New SkillsWindow(StartPosition)
                Desktop.AddChildWindow(SkillsWindow.MyWindow)
                UpdateStartPosition()
            Catch ex As Exception
                Console.WriteLine(ex.Message)
            End Try
        End Sub

So there you have it... my entire GUI system is set up, and new instances of all of my windows are now created. So what does it look like?

Ogredotnetceguiwikiexample.png

In this example, you see the QuitQueryWindow, WelcomeWindow, and ChatTarget StaticText object.

Setting up custom classes

So how do I have that WelcomeWindow all defined just by calling "new WelcomeWindow"? The answer is to set up custom classes for each window type you want to create, and within it have all of your definitions for layout and objects within them. Of course, there will be some standard behaviors and objects that will be used in ALL of your framewindows, and some things that will be used in all of your Tab Pages... so why not set up base classes and use inheritance?

I start with "WindowBase":

Public Class WindowBase
        Private reader As StreamReader
        Public WM As WindowManager = WindowManager.Instance
        Public Function GetDescription(ByVal BasePath As String, ByVal WhatFile As String) As String
            Try
                BasePath = "/data/descriptions/" & BasePath & "/"
                BasePath = BasePath.Replace("//", "/")
                If File.Exists(App_Path() & BasePath & WhatFile & ".txt") Then
                    reader = New StreamReader(App_Path() & BasePath & WhatFile & ".txt")
                    Return reader.ReadToEnd
                Else
                    File.Create(App_Path() & BasePath & WhatFile & ".txt")
                    Return "Help file not found.  Blank one created.  Please update your client."
                End If
            Catch ex As Exception
                Return "Error reading help text file"
            End Try
        End Function
    End Class

All of my frame and tab windows will have a help or description statictext object that will show help files, so I figured I'd create a single sub for all of them to use, and since they all inherit from this same base class, this was a good place to put this function.

The more important part of this is the "WM" object being defined as the WindowManager.Instance. I got tired of having long bulky code with the "WindowManager.Instance.Create(whatever)" being everywhere. So now it's just WM.Create(whatever), and things are much cleaner.

So what inherits this base class?

FrameWindowBase!

Public Class FrameWindowBase
        Inherits WindowBase
        Public WithEvents MyWindow As FrameWindow
        Public Overridable Function Shown(ByVal e As WindowEventArgs) As Boolean Handles MyWindow.Shown
            If MyWindow.getWidth + MyWindow.getPosition.d_x > 1 Then
                MyWindow.SetPosition(1 - MyWindow.getWidth, MyWindow.getPosition.d_y)
            End If
            If MyWindow.getHeight + MyWindow.getPosition.d_y > 1 Then
                MyWindow.SetPosition(MyWindow.getPosition.d_x, 1 - MyWindow.getHeight)
            End If
            If MyWindow.getPosition.d_x < 0 Then
                MyWindow.SetPosition(0, MyWindow.getPosition.d_y)
            End If
            If MyWindow.getPosition.d_y < 0 Then
                MyWindow.SetPosition(MyWindow.getPosition.d_x, 0)
            End If
            MyWindow.setAlwaysOnTop(True)
            MyWindow.setAlwaysOnTop(False)
        End Function
        Public Sub CenterWindow()
            MyWindow.SetPosition((Convert.ToSingle(Client.Engine.Window.Width) - MyWindow.getWidth) / 2, (Convert.ToSingle(Client.Engine.Window.Height) - MyWindow.getHeight) / 2)
        End Sub
        Public Sub SetupWindow()
            MyWindow.setMetricsMode(MetricsMode.Absolute)
            MyWindow.setRollupEnabled(False)
            MyWindow.setSizingBorderThickness(0)
            MyWindow.setFrameEnabled(False)
            MyWindow.SubscribeEvents()
            MyWindow.activate()
        End Sub
        Public Overridable Function CloseClickedHandler(ByVal e As WindowEventArgs) As Boolean Handles MyWindow.CloseClicked
            MyWindow.hide()
        End Function
    End Class

As you can see, I have a single sub to setup any frame window to act the way I want my framewindows to act. Also, remember how I said I don't destroy my windows when they're closed, I just hide them? I overrode the CloseClicked event to say "hide the window" instead of destroying it.

The other functions are pretty self-explanitory, but I included them here to give people ideas for how to do things in their own code.

There are other base classes that inherits WindowBase, but I'm not showing them here... all of them, however, have a single "MyWindow" object... this is a naming convention I decided on that has proven to be effective.

So let's look at WelcomeWindow. You see how it's laid out in the above screenshot, so let's see how I did that in code.

Public Class WelcomeWindow
        Inherits FrameWindowBase

Ahh, you see? It inherits FrameWindowBase, which inherits WindowBase...

'Buttons
        Public WithEvents btnLogin As ButtonBase
        Public WithEvents btnOptions As ButtonBase
 
        ' Static Text Items
        Public WelcomeText As StaticText
        Public StatusText As StaticText
        Private DefaultMessage As String = "To begin, enter user name and password, then click login."
        Public UNLabel As StaticText
        Public PWLabel As StaticText
 
        'Fields
        Public WithEvents UNField As Editbox
        Public WithEvents PWField As Editbox
 
        'Alignment variables
        Private MaxSize As New Size(600, 400)
        Private RowHeight As Single = 27
        Private ButtonSize As New Size(100, RowHeight)
        Private LabelSize As New Size(76, RowHeight)
        Private LeftAlign As Single = 10
        Private FieldSize As New Size(MaxSize.d_width - (LeftAlign * 4) - LabelSize.d_width - ButtonSize.d_width, RowHeight)
        Private MidAlign As Single = LabelSize.d_width + (LeftAlign * 2)
        Private RightAlign As Single = MaxSize.d_width - LeftAlign - ButtonSize.d_width
        Private BottomRow As Single = MaxSize.d_height - LeftAlign - RowHeight
        Private PWRow As Single = BottomRow - RowHeight - LeftAlign
        Private UNRow As Single = PWRow - RowHeight - LeftAlign

As you can see, I set up my formatting using formulas rather than messing around with static values. This is quite handy, as it makes things easier to format without having to endlessly tweak numbers around.

Sub New()
            Try
                MyWindow = WM.CreateFrameWindow(FrameWindow, "WelcomeWindow")

Remember, I have my CEGUI widget constants: Public FrameWindow As String = "TaharezLook/FrameWindow"

SetupWindow()
                MyWindow.Text = "Welcome to Vermund : A Matter of Life and Death!"
                MyWindow.SetSize(MaxSize)
                CenterWindow()
                SetupLoginArea()
                SetupButtons()
                SetupStaticText()
                MyWindow.Show()
            Catch ex As Exception
                'Replace with Error Logging
            End Try
        End Sub

The "SetupWindow" call references the base class you saw above... it's a handly little thing that saves me time in setting up my frame windows, and allows me to change the default behavior of ALL of my frame windows without doing a massive search/replace.

So now we set up the various objects:

Private Sub SetupLoginArea()
            Try
                UNLabel = WM.CreateStaticText(StaticTxt, "lblUN")
                UNLabel.setMetricsMode(MetricsMode.Absolute)
                UNLabel.SetPosition(LeftAlign, UNRow)
                UNLabel.SetSize(LabelSize)
                UNLabel.setFrameEnabled(False)
                UNLabel.setFormatting(StaticText.HorzFormatting.LeftAligned, StaticText.VertFormatting.VertCentred)
                UNLabel.Text = "User Name"
                MyWindow.AddChildWindow(UNLabel)
 
                UNField = WM.CreateEditbox(Editbox, "txtUNField")
                UNField.SubscribeEvents()
                UNField.setMetricsMode(MetricsMode.Absolute)
                UNField.SetPosition(MidAlign, UNRow)
                UNField.SetSize(FieldSize)
                UNField.Text = ""
                MyWindow.AddChildWindow(UNField)
 
                PWLabel = WM.CreateStaticText(StaticTxt, "lblPW")
                PWLabel.setMetricsMode(MetricsMode.Absolute)
                PWLabel.SetPosition(LeftAlign, PWRow)
                PWLabel.SetSize(LabelSize)
                PWLabel.setFrameEnabled(False)
                PWLabel.setFormatting(StaticText.HorzFormatting.LeftAligned, StaticText.VertFormatting.VertCentred)
                PWLabel.Text = "Password"
                MyWindow.AddChildWindow(PWLabel)
 
                PWField = WM.CreateEditbox(Editbox, "txtPWField")
                PWField.SubscribeEvents()
                PWField.setMetricsMode(MetricsMode.Absolute)
                PWField.SetPosition(MidAlign, PWRow)
                PWField.SetSize(FieldSize)
                PWField.setTextMasked(True)
                MyWindow.AddChildWindow(PWField)
            Catch ex As Exception
                'Replace with Error Logging
            End Try
        End Sub
 
        Private Sub SetupButtons()
            Try
                btnLogin = WM.CreateButtonBase(Button, "btnLogin")
                btnLogin.setMetricsMode(MetricsMode.Absolute)
                btnLogin.SetPosition(RightAlign, UNRow)
                btnLogin.SetSize(ButtonSize)
                btnLogin.Text = "Login"
                btnLogin.SubscribeEvents()
                MyWindow.AddChildWindow(btnLogin)
 
                btnOptions = WM.CreateButtonBase(Button, "btnOptions")
                btnOptions.setMetricsMode(MetricsMode.Absolute)
                btnOptions.SetPosition(RightAlign, PWRow)
                btnOptions.SetSize(ButtonSize)
                btnOptions.Text = "Options"
                btnOptions.SubscribeEvents()
                MyWindow.AddChildWindow(btnOptions)
            Catch ex As Exception
                'Replace with Error Logging
            End Try
        End Sub
 
        Private Sub SetupStaticText()
            Try
                WelcomeText = WM.CreateStaticText(StaticTxt, "txtWelcome")
                WelcomeText.setMetricsMode(MetricsMode.Absolute)
                WelcomeText.SetPosition(LeftAlign, LeftAlign * 4)
                WelcomeText.SetSize(MaxSize.d_width - (LeftAlign * 2), UNRow - (LeftAlign * 5))
                WelcomeText.setVerticalScrollbarEnabled(True)
                WelcomeText.setFormatting(StaticText.HorzFormatting.WordWrapLeftAligned, StaticText.VertFormatting.TopAligned)
                If File.Exists(App_Path() & "\MOTD.txt") Then
                    Dim MyReader As New System.IO.StreamReader(App_Path() & "\MOTD.txt")
                    WelcomeText.Text = MyReader.ReadToEnd.ToString
                Else
                    WelcomeText.Text = "Error: Message Of The Day File Not Found"
                End If
                MyWindow.AddChildWindow(WelcomeText)
 
                StatusText = WM.CreateStaticText(StaticTxt, "txtStatus")
                StatusText.setMetricsMode(MetricsMode.Absolute)
                StatusText.SetPosition(LeftAlign, BottomRow)
                StatusText.SetSize(MaxSize.d_width - (LeftAlign * 2), FieldSize.d_height)
                StatusText.setFormatting(StaticText.HorzFormatting.LeftAligned, StaticText.VertFormatting.VertCentred)
                StatusText.Text = DefaultMessage
                MyWindow.AddChildWindow(StatusText)
            Catch ex As Exception
            End Try
        End Sub

Now, people will tell you that XML is soooo much easier and nicer... I disagree. I find it much easier to write this code above than to write a bunch of bulky XML. Now if you're using a layout editor that writes the XML for you, that's another story... but I still prefer code.

Handling CEGUI events

Next we have the event handlers. VB.NET differs from C# in this one major way and it confuses a lot of people. You'll notice that above, I declared btnLogin and btnOptions "withevents".

Public WithEvents btnOptions As ButtonBase

This tells the compiler that we're setting up our own handler functions for events raised by that object. For example:

Public Function OptionsClicked(ByVal e As MouseEventArgs) As Boolean Handles btnOptions.MouseClick
            Client.Engine.OptionsWindow.MyWindow.Show()
        End Function

This function must have the same signature as the event raised by the button object... so it MUST be a function (not a sub) that returns a Boolean value (even though it's likely never used), and it must accept the argument "MouseEventArgs". The "Handles" keyword at the end tells the compiler which event(s) this function is responsible for handling.

Notice how I reference my public object OptionsWindow, which has within it, of course, a "MyWindow" object... and I tell it to show itself.

I have other event handlers, but they're pretty specific to my needs and not of value here. As long as you understand how to set up events, that's all I'm going for.

Conclusion

So now you should know how to set up your GUI system, default GUISheet, elements on top of the GUISheet (like a statictext object), FrameWindows, etc... plus set up your layouts, work with inheritance to make things easier on you, and set up event handlers for CEGUI objects.

If you have any questions, please feel free to visit the OgreDotNet forums and post a help request there.

<HR>
Creative Commons Copyright -- Some rights reserved.


THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  • "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  • "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  • "Licensor" means the individual or entity that offers the Work under the terms of this License.
  • "Original Author" means the individual or entity who created the Work.
  • "Work" means the copyrightable work of authorship offered under the terms of this License.
  • "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
  • "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.

2. Fair Use Rights

Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant

Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  • to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  • to create and reproduce Derivative Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
  • For the avoidance of doubt, where the work is a musical composition:
    • Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    • Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
    • Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).


The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions

The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  • You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
  • You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
  • If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability.

EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  • This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  • Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  • Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  • Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  • If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  • No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  • This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.