Toolbox 0.0.1
Ritchie's accessible game engine'
Loading...
Searching...
No Matches
GuiManager Class Referencesealed
Inheritance diagram for GuiManager:
IFontFamilyProvider ITextInputHandler

Public Member Functions

 GuiManager (IGuiContext context, IOverlayCreator? overlayCreator=null)
 
void InvalidateAllGeometry ()
 Invalidates the geometry of all interface elements recursively. Use this when changing a global UI setting that affects how all widgets render. Note: This is expensive. That should be obvious. So do not call it every frame.
 
bool IsFocused (Widget widget)
 
void SetFocusedWidget (Widget? widgetToFocus)
 
WidgetFindWidget (Point position, bool includeDisabled=false, bool includeHidden=false)
 Find a widget under the specified position on the canvas.
 
T? FindWidget< T > (bool includeDisabled=false, bool includeHidden=false)
 
T? FindWidget< T > (Point position, bool includeDisabled=false, bool includeHidden=false)
 Find a widget of the specified type under the specified position on the canvas.
 
bool SendMouseButton (MouseButtonEventArgs e)
 
bool SendKey (Keys key, ButtonState state)
 
void SetMouseState (MouseState state)
 
void UpdateLayout ()
 
void Update (float deltaTime)
 
IVisualStyle GetVisualStyle ()
 
void Render (Matrix4x4 projectionMatrix, FrameBuffer? screenBuffer=null)
 
IFontFamily GetFont (PresetFontFamily family)
 
void OnTextInput (TextInputEvent e)
 
IOverlayContainer CreateOverlay (string title)
 

Properties

static ? GuiManager Current [get]
 
Vector2 GuiScale [get]
 
int ScreenWidth [get]
 
int ScreenHeight [get]
 
GuiScaleMode ScaleMode [get, set]
 
int ReferenceWidth [get, set]
 
int ReferenceHeight [get, set]
 
float ViewportScaleRatio [get, set]
 
bool IsRendering [get]
 
IOrderedCollection< WidgetTopLevels [get]
 

Events

Action< MouseButtonEvent >? MouseDown
 
Action< MouseButtonEvent >? MouseClicked
 
Action< MouseButtonEvent >? MouseUp
 

Member Function Documentation

◆ FindWidget()

Widget? FindWidget ( Point position,
bool includeDisabled = false,
bool includeHidden = false )
inline

Find a widget under the specified position on the canvas.

Parameters
positionThe position, in canvas units, to find a widget under.
includeDisabledWhether or not disabled widgets should be counted.
includeHiddenWhether or not visyally-hidden widgets should be counted.
Returns
An instance of Widget representing the found widget, or null if none was found.

◆ FindWidget< T >()

T? FindWidget< T > ( Point position,
bool includeDisabled = false,
bool includeHidden = false )
inline

Find a widget of the specified type under the specified position on the canvas.

Template Parameters
TThe type of widget to find, or an interface it should implement.
Parameters
positionThe position, in canvas units, to find a widget under.
includeDisabledWhether or not disabled widgets should be counted.
includeHiddenWhether or not visyally-hidden widgets should be counted.
Returns
An instance of T representing the found widget, or null if none was found.

◆ GetFont()

IFontFamily GetFont ( PresetFontFamily family)
inline

Implements IFontFamilyProvider.

◆ OnTextInput()

void OnTextInput ( TextInputEvent e)
inline

Implements ITextInputHandler.


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