Class MyraEnvironment
- Namespace
- Myra
- Assembly
- Myra.dll
Provides global configuration and utility methods for Myra UI framework.
public static class MyraEnvironment
- Inheritance
-
MyraEnvironment
- Inherited Members
Properties
DarkeningColor
Gets or sets the color used to darken the background when modal dialogs are displayed.
public static Color DarkeningColor { get; set; }
Property Value
- Color
DefaultAssetManager
Gets or sets the asset manager used to load default assets.
public static AssetManager DefaultAssetManager { get; set; }
Property Value
- AssetManager
DefaultMouseCursorType
Gets or sets the default mouse cursor type to display when no widget-specific cursor is active.
public static MouseCursorType DefaultMouseCursorType { get; set; }
Property Value
DisableClipping
Gets or sets a value indicating whether clipping is disabled (useful for debugging).
public static bool DisableClipping { get; set; }
Property Value
DoubleClickIntervalInMs
Gets or sets the time interval in milliseconds for double-click detection.
public static int DoubleClickIntervalInMs { get; set; }
Property Value
DoubleClickRadius
Gets or sets the pixel radius within which a second click is considered a double-click.
public static int DoubleClickRadius { get; set; }
Property Value
DownKeysGetter
Gets or sets the function used to retrieve which keys are currently pressed.
public static Action<bool[]> DownKeysGetter { get; set; }
Property Value
DrawKeyboardFocusedWidgetFrame
Gets or sets a value indicating whether to draw a debug frame around the keyboard-focused widget.
public static bool DrawKeyboardFocusedWidgetFrame { get; set; }
Property Value
DrawMouseHoveredWidgetFrame
Gets or sets a value indicating whether to draw a debug frame around the widget under the mouse cursor.
public static bool DrawMouseHoveredWidgetFrame { get; set; }
Property Value
DrawMouseHoveredWidgetInfo
Gets or sets a value indicating whether to draw information about the widget under the mouse cursor.
public static bool DrawMouseHoveredWidgetInfo { get; set; }
Property Value
DrawTextGlyphsFrames
Gets or sets a value indicating whether to draw debug frames around text glyphs.
public static bool DrawTextGlyphsFrames { get; set; }
Property Value
DrawWidgetsFrames
Gets or sets a value indicating whether to draw debug frames around all widgets.
public static bool DrawWidgetsFrames { get; set; }
Property Value
EnableModalDarkening
Gets or sets a value indicating whether modal dialogs should darken the background.
public static bool EnableModalDarkening { get; set; }
Property Value
EventHandlingModel
Gets or sets the event handling strategy used for input events (event capturing or event bubbling).
public static EventHandlingStrategy EventHandlingModel { get; set; }
Property Value
Game
Gets or sets the game instance that Myra uses for rendering. Must be set before using Myra.
public static Game Game { get; set; }
Property Value
- Game
GraphicsDevice
Gets the graphics device from the current game instance.
public static GraphicsDevice GraphicsDevice { get; }
Property Value
- GraphicsDevice
IsMobile
Gets a value indicating whether the current platform is a mobile platform.
public static bool IsMobile { get; }
Property Value
MouseCursorType
Gets or sets the current mouse cursor type displayed.
public static MouseCursorType MouseCursorType { get; set; }
Property Value
MouseInfoGetter
Gets or sets the function used to retrieve the current mouse information.
public static Func<MouseInfo> MouseInfoGetter { get; set; }
Property Value
RepeatKeyDownInternalInMs
Gets or sets the interval in milliseconds between key repeat events. Defaults to 50.
public static int RepeatKeyDownInternalInMs { get; set; }
Property Value
RepeatKeyDownStartInMs
Gets or sets the delay in milliseconds before a pressed key starts repeating. Defaults to 500.
public static int RepeatKeyDownStartInMs { get; set; }
Property Value
SetMouseCursorFromWidget
Gets or sets a value indicating whether the mouse cursor type should be automatically changed based on the hovered widget.
public static bool SetMouseCursorFromWidget { get; set; }
Property Value
SmoothText
Gets or sets a value indicating whether text rendering should be smoothed (especially when scaling) at the cost of performance.
public static bool SmoothText { get; set; }
Property Value
TooltipCreator
Gets or sets the function used to create tooltip widgets.
public static Func<Widget, Widget> TooltipCreator { get; set; }
Property Value
TooltipDelayInMs
Gets or sets the delay in milliseconds before showing a tooltip.
public static int TooltipDelayInMs { get; set; }
Property Value
TooltipOffset
Gets or sets the offset from the mouse cursor where tooltips are displayed.
public static Point TooltipOffset { get; set; }
Property Value
- Point
Version
Gets the version number of Myra.
public static string Version { get; }
Property Value
Methods
DefaultDownKeysGetter(bool[])
Gets which keyboard keys are currently pressed from the game instance.
public static void DefaultDownKeysGetter(bool[] keys)
Parameters
keysbool[]An array to be filled with boolean values indicating which keys are pressed.
DefaultMouseInfoGetter()
Gets the current mouse information from the game instance.
public static MouseInfo DefaultMouseInfoGetter()
Returns
- MouseInfo
A MouseInfo struct containing the current mouse position and button states.
Reset()
Resets the Myra environment, disposing of cached assets and stylesheets.
public static void Reset()