UserInterface Class

GeonBit.UI

UserInterface Class
Main GeonBit.UI class that manage and draw all the UI entities. This is the main manager you use to update, draw, and add entities to.
Inheritance Hierarchy
SystemObject  GeonBit.UIUserInterface

Namespace:  GeonBit.UI
Assembly:  GeonBit.UI (in GeonBit.UI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class UserInterface : IDisposable

The UserInterface type exposes the following members.

Constructors
  NameDescription
Public methodUserInterface
Create the user interface instance.
Top
Properties
  NameDescription
Public propertyGlobalScale
Scale the entire UI and all the entities in it. This is useful for smaller device screens.
Public propertyRenderTarget
Get the main render target all the UI draws on.
Public propertyRoot
Get the root entity.
Public propertyTargetEntity
The current target entity, eg what cursor points on. Can be null if cursor don't point on any entity.
Public propertyUseRenderTarget
If true, will draw the UI on a render target before drawing on screen. This mode is required for some of the features.
Top
Methods
  NameDescription
Public methodAddEntity
Add an entity to screen.
Public methodClear
Remove all entities from screen.
Public methodDispose
Dispose unmanaged resources of this user interface.
Public methodDraw
Draw the UI. This function should be called from your Game 'Draw()' function. Note: if UseRenderTarget is true, this function should be called FIRST in your draw function. If UseRenderTarget is false, this function should be called LAST in your draw function.
Public methodDrawCursor
Draw the cursor.
Public methodDrawMainRenderTarget
Finalize the draw frame and draw all the UI on screen. This function only works if we are in UseRenderTarget mode.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetTransformedCursorPos
Get transformed cursoer position for collision detection. If have transform matrix and curser is included in render target, will transform cursor position too. If don't use transform matrix or drawing cursor outside, will not transform cursor position.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberInitialize(ContentManager, BuiltinThemes)
Initialize UI manager (mostly load resources and set some defaults).
Public methodStatic memberInitialize(ContentManager, String)
Initialize UI manager (mostly load resources and set some defaults).
Public methodRemoveEntity
Remove an entity from screen.
Public methodSetCursor(CursorType)
Set cursor style.
Public methodSetCursor(Texture2D, Int32, NullablePoint)
Set cursor graphics from a custom texture.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Update the UI manager. This function should be called from your Game 'Update()' function, as early as possible (eg before you update your game state).
Top
Fields
  NameDescription
Public fieldStatic memberActive
The currently active user interface instance.
Public fieldActiveEntity
Current active entity, eg last entity user interacted with.
Public fieldAfterDraw
Callback to execute every frame after entity is rendered.
Public fieldAfterUpdate
Callback to execute every frame after entity update.
Public fieldBeforeDraw
Callback to execute every frame before entity is rendered.
Public fieldBeforeUpdate
Callback to execute every frame before entity update.
Public fieldBlendState
Blend state to use when rendering UI.
Public fieldCursorScale
Cursor rendering size.
Public fieldStatic memberDefaultParagraph
Create a default paragraph instance. GeonBit.UI entities use this method when need to create a paragraph, so you can override this to change which paragraph type the built-in entities will use by-default (for example Buttons text, SelectList items, etc.).
Public fieldDrawUtils
Draw utils helper. Contain general drawing functionality and handle effects replacement.
Public fieldGenerateTooltipFunc
The function used to generate tooltip text on entities.
Public fieldIncludeCursorInRenderTarget
If using render targets, should the curser be rendered inside of it? If false, cursor will draw outside the render target, when presenting it.
Public fieldOnClick
Callback to execute when user clicks on an entity (eg release mouse over it).
Public fieldOnEntitySpawn
Callback to execute every time a new entity is spawned (note: spawn = first time Update() is called on this entity).
Public fieldOnFocusChange
Callback to execute every time an entity focus changes.
Public fieldOnMouseDown
Callback to execute when mouse button is pressed over an entity (called once when button is pressed).
Public fieldOnMouseEnter
Callback to execute when mouse start hovering over an entity (eg enters its region).
Public fieldOnMouseLeave
Callback to execute when mouse stop hovering over an entity (eg leaves its region).
Public fieldOnMouseReleased
Callback to execute when mouse button is released over an entity (called once when button is released).
Public fieldOnMouseWheelScroll
Callback to execute when mouse wheel scrolls and an entity is the active entity.
Public fieldOnStartDrag
Called when entity starts getting dragged (only if draggable).
Public fieldOnStopDrag
Called when entity stop getting dragged (only if draggable).
Public fieldOnValueChange
Callback to execute when any entity value changes (relevant only for entities with value).
Public fieldOnVisiblityChange
Callback to execute every time the visibility property of an entity change.
Public fieldRenderTargetTransformMatrix
Optional transformation matrix to apply when drawing with render targets.
Public fieldSamplerState
Sampler state to use when rendering UI.
Public fieldScreenHeight
Screen height.
Public fieldScreenWidth
Screen width.
Public fieldShowCursor
Weather or not to draw the cursor.
Public fieldSilentSoftErrors
If true, GeonBit.UI will not raise exceptions on sanity checks, validations, and errors which are not critical. For example, trying to select a value that doesn't exist from a list would do nothing instead of throwing exception.
Public fieldStatic memberTimeToShowTooltipText
How long to wait before showing tooltip texts.
Public fieldStatic memberVERSION
Current GeonBit.UI version identifier.
Public fieldWhileDragging
Called every frame while entity is being dragged.
Public fieldWhileMouseDown
Callback to execute every frame while mouse button is pressed over an entity.
Public fieldWhileMouseHover
Callback to execute every frame while mouse is hovering over an entity.
Top
See Also