Otter  0.9.88
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.UI.UIMenu Class Reference

OTTER UI IS NOT SUPPORTED YET. ACTIVELY IN DEVELOPMENT, USE AT YOUR OWN RISK! Base class that all UI menus extend. More...

Inherits Otter.UI.UIElement.

Inherited by Otter.UI.UIGridMenu, Otter.UI.UIInputMenu, Otter.UI.UIListMenu, and Otter.UI.UIValueMenu.

Public Member Functions

AddMenuItem< T > (T menuItem)
 Add a menu item to the menu. More...
 
List< UIElementAddMenuItems (params UIElement[] menuItems)
 Add multiple menu items to the menu. More...
 
virtual void UpdateMenuPositions ()
 Update the positions of the menu items. More...
 
virtual void ItemSwitched ()
 Called when the user has switched the currently selected item. More...
 
override void Canceled ()
 
override void Update ()
 
virtual void CancelAndDeactivate (UIManager manager)
 A shortcut to cancel and deactivate the menu. More...
 
virtual void TriggerAndDeactivate (UIManager manager)
 A shortcut to trigger and deactivate the menu. More...
 
override void Render ()
 
- Public Member Functions inherited from Otter.UI.UIElement
void Highlight ()
 
void Dim ()
 
void Summon ()
 
void Dismiss ()
 
void Trigger ()
 
void Cancel ()
 
Graphic AddGraphic (Graphic g)
 
List< GraphicAddGraphics (params Graphic[] graphics)
 
AddElement< T > (T uielement)
 
List< UIElementAddElements (params UIElement[] uielements)
 
RemoveElement< T > (T uielement)
 
virtual void Triggered ()
 
virtual void Highlighted ()
 
virtual void Dimmed ()
 
virtual void Enabled ()
 
virtual void Disabled ()
 
virtual void Dismissed ()
 
virtual void Summoned ()
 
virtual void Activated ()
 
virtual void Deactivated ()
 
virtual void Enable ()
 
virtual void Disable ()
 
virtual void HandleInput (UIManager manager)
 Handle input from a manager if this element is active. More...
 

Public Attributes

bool Cancelable = false
 If the UIMenu can be canceled by the UIManager or not. Default to false for the base menu. More...
 
- Public Attributes inherited from Otter.UI.UIElement
int InputStartUp = 0
 How many frames to wait before accepting input. Use this to prevent accidental double inputs. More...
 
List< UIElementElements = new List<UIElement>()
 
bool Visible = true
 
bool UseMouse = false
 
Action OnTrigger
 
int Width = 0
 
bool InheritHighlight = false
 

Properties

List< UIElementMenuItems [get, set]
 
UIElement this[int index] [get]
 Get a menu item from the menu. More...
 
virtual UIElement CurrentMenuItem [get]
 The currently selected menu item. More...
 
virtual UIElement LastMenuItem [get]
 The last menu item in the list. More...
 
- Properties inherited from Otter.UI.UIElement
UIManager Manager [get, set]
 
UIElement Parent [get, set]
 
virtual float X [get, set]
 
virtual float Y [get, set]
 
int UIDepth [get, set]
 
bool IsEnabled [get, set]
 

Detailed Description

OTTER UI IS NOT SUPPORTED YET. ACTIVELY IN DEVELOPMENT, USE AT YOUR OWN RISK! Base class that all UI menus extend.

Member Function Documentation

T Otter.UI.UIMenu.AddMenuItem< T > ( menuItem)

Add a menu item to the menu.

Template Parameters
TInferred by the menu item parameter.
Parameters
menuItemThe menu item to add.
Returns
The menu item.
Type Constraints
T :UIElement 
List<UIElement> Otter.UI.UIMenu.AddMenuItems ( params UIElement[]  menuItems)

Add multiple menu items to the menu.

Parameters
menuItemsThe menu items to add.
Returns
The list of added menu items.
virtual void Otter.UI.UIMenu.CancelAndDeactivate ( UIManager  manager)
virtual

A shortcut to cancel and deactivate the menu.

Parameters
manager
virtual void Otter.UI.UIMenu.ItemSwitched ( )
virtual

Called when the user has switched the currently selected item.

virtual void Otter.UI.UIMenu.TriggerAndDeactivate ( UIManager  manager)
virtual

A shortcut to trigger and deactivate the menu.

Parameters
manager
virtual void Otter.UI.UIMenu.UpdateMenuPositions ( )
virtual

Update the positions of the menu items.

Reimplemented in Otter.UI.UIGridMenu.

Member Data Documentation

bool Otter.UI.UIMenu.Cancelable = false

If the UIMenu can be canceled by the UIManager or not. Default to false for the base menu.

Property Documentation

virtual UIElement Otter.UI.UIMenu.CurrentMenuItem
get

The currently selected menu item.

virtual UIElement Otter.UI.UIMenu.LastMenuItem
get

The last menu item in the list.

UIElement Otter.UI.UIMenu.this[int index]
get

Get a menu item from the menu.

Parameters
idThe index of the item.
Returns
The menu item at that index.

The documentation for this class was generated from the following file: