UserInterface Class |
Namespace: GeonBit.UI
public class UserInterface : IDisposable
The UserInterface type exposes the following members.
Name | Description | |
---|---|---|
UserInterface |
Create the user interface instance.
|
Name | Description | |
---|---|---|
CurrGameTime |
Get current game time value.
| |
GlobalScale | Scale the entire UI and all the entities in it. This is useful for smaller device screens. | |
RenderTarget |
Get the main render target all the UI draws on.
| |
Root |
Get the root entity.
| |
TargetEntity | The current target entity, eg what cursor points on. Can be null if cursor don't point on any entity. | |
UseRenderTarget |
If true, will draw the UI on a render target before drawing on screen.
This mode is required for some of the features.
|
Name | Description | |
---|---|---|
AddEntity |
Add an entity to screen.
| |
Clear |
Remove all entities from screen.
| |
Deserialize(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.
| |
Deserialize(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.
| |
Dispose |
Dispose unmanaged resources of this user interface.
| |
Draw |
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.
| |
DrawCursor |
Draw the cursor.
| |
DrawMainRenderTarget |
Finalize the draw frame and draw all the UI on screen.
This function only works if we are in UseRenderTarget mode.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetTransformedCursorPos |
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.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Initialize(ContentManager, BuiltinThemes) |
Initialize UI manager (mostly load resources and set some defaults).
| |
Initialize(ContentManager, String) |
Initialize UI manager (mostly load resources and set some defaults).
| |
RemoveEntity |
Remove an entity from screen.
| |
Serialize(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.
| |
Serialize(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.
| |
SetCursor(CursorType) |
Set cursor style.
| |
SetCursor(Texture2D, Int32, NullablePoint) |
Set cursor graphics from a custom texture.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Update |
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).
|
Name | Description | |
---|---|---|
Active |
The currently active user interface instance.
| |
ActiveEntity | Current active entity, eg last entity user interacted with. | |
AfterDraw | Callback to execute every frame after entity is rendered. | |
AfterUpdate | Callback to execute every frame after entity update. | |
BeforeDraw | Callback to execute every frame before entity is rendered. | |
BeforeUpdate | Callback to execute every frame before entity update. | |
BlendState |
Blend state to use when rendering UI.
| |
CursorScale | Cursor rendering size. | |
DebugDraw |
If true, will add debug rendering to UI.
| |
DefaultParagraph |
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.).
| |
DrawUtils | Draw utils helper. Contain general drawing functionality and handle effects replacement. | |
GenerateTooltipFunc |
The function used to generate tooltip text on entities.
| |
IncludeCursorInRenderTarget |
If using render targets, should the curser be rendered inside of it?
If false, cursor will draw outside the render target, when presenting it.
| |
KeyboardInputProvider |
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.
| |
MouseInputProvider |
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.
| |
OnClick | Callback to execute when user clicks on an entity (eg release mouse over it). | |
OnEntitySpawn | Callback to execute every time a new entity is spawned (note: spawn = first time Update() is called on this entity). | |
OnFocusChange | Callback to execute every time an entity focus changes. | |
OnMouseDown | Callback to execute when mouse button is pressed over an entity (called once when button is pressed). | |
OnMouseEnter | Callback to execute when mouse start hovering over an entity (eg enters its region). | |
OnMouseLeave | Callback to execute when mouse stop hovering over an entity (eg leaves its region). | |
OnMouseReleased | Callback to execute when mouse button is released over an entity (called once when button is released). | |
OnMouseWheelScroll | Callback to execute when mouse wheel scrolls and an entity is the active entity. | |
OnRightClick | Callback to execute when user clicks on an entity with right mouse button (eg release mouse over it). | |
OnRightMouseDown | Callback to execute when right mouse button is pressed over an entity (called once when button is pressed). | |
OnStartDrag | Called when entity starts getting dragged (only if draggable). | |
OnStopDrag | Called when entity stop getting dragged (only if draggable). | |
OnValueChange | Callback to execute when any entity value changes (relevant only for entities with value). | |
OnVisiblityChange | Callback to execute every time the visibility property of an entity change. | |
RenderTargetTransformMatrix |
Optional transformation matrix to apply when drawing with render targets.
| |
SamplerState |
Sampler state to use when rendering UI.
| |
ScreenHeight | Screen height. | |
ScreenWidth | Screen width. | |
ShowCursor | Whether or not to draw the cursor. | |
SilentSoftErrors |
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.
| |
TimeToShowTooltipText |
How long to wait before showing tooltip texts.
| |
VERSION | Current GeonBit.UI version identifier. | |
WhileDragging | Called every frame while entity is being dragged. | |
WhileMouseDown | Callback to execute every frame while mouse button is pressed over an entity. | |
WhileMouseHover | Callback to execute every frame while mouse is hovering over an entity, unless mouse button is down. | |
WhileMouseHoverOrDown | Callback to execute every frame while mouse is hovering over an entity, even if mouse button is down. | |
WhileRightMouseDown | Callback to execute every frame while right mouse button is pressed over an entity. |