Click or drag to resize
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 propertyCurrGameTime
Get current game time value.
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 methodDeserialize(Stream)
Deserialize the whole UI from stream. Note: serialization have some limitation and things that will not be included in xml, like even handlers. Please read docs carefuly to know what to expect.
Public methodDeserialize(String)
Deserialize the whole UI from filename. Note: serialization have some limitation and things that will not be included in xml, like even handlers. Please read docs carefuly to know what to expect.
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 methodSerialize(Stream)
Serialize the whole UI to stream. Note: serialization have some limitation and things that will not be included in xml, like even handlers. Please read docs carefuly to know what to expect.
Public methodSerialize(String)
Serialize the whole UI to filename. Note: serialization have some limitation and things that will not be included in xml, like even handlers. Please read docs carefuly to know what to expect.
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 fieldDebugDraw
If true, will add debug rendering to UI.
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 fieldKeyboardInputProvider
The object that provide keyboard and typing input for GeonBit UI. By default it uses internal implementation that uses MonoGame keyboard input. If you want to use alternative typing methods, you can override and replace this instance with your own object that emulates keyboard input.
Public fieldMouseInputProvider
The object that provide mouse input for GeonBit UI. By default it uses internal implementation that uses MonoGame mouse input. If you want to use things like Touch input, you can override and replace this instance with your own object that emulates mouse input from different sources.
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 fieldOnRightClick
Callback to execute when user clicks on an entity with right mouse button (eg release mouse over it).
Public fieldOnRightMouseDown
Callback to execute when right mouse button is pressed over an entity (called once when button is pressed).
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
Whether 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, unless mouse button is down.
Public fieldWhileMouseHoverOrDown
Callback to execute every frame while mouse is hovering over an entity, even if mouse button is down.
Public fieldWhileRightMouseDown
Callback to execute every frame while right mouse button is pressed over an entity.
Top
See Also