Table of Contents

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

MouseCursorType

DisableClipping

Gets or sets a value indicating whether clipping is disabled (useful for debugging).

public static bool DisableClipping { get; set; }

Property Value

bool

DoubleClickIntervalInMs

Gets or sets the time interval in milliseconds for double-click detection.

public static int DoubleClickIntervalInMs { get; set; }

Property Value

int

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

int

DownKeysGetter

Gets or sets the function used to retrieve which keys are currently pressed.

public static Action<bool[]> DownKeysGetter { get; set; }

Property Value

Action<bool[]>

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

bool

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

bool

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

bool

DrawTextGlyphsFrames

Gets or sets a value indicating whether to draw debug frames around text glyphs.

public static bool DrawTextGlyphsFrames { get; set; }

Property Value

bool

DrawWidgetsFrames

Gets or sets a value indicating whether to draw debug frames around all widgets.

public static bool DrawWidgetsFrames { get; set; }

Property Value

bool

EnableModalDarkening

Gets or sets a value indicating whether modal dialogs should darken the background.

public static bool EnableModalDarkening { get; set; }

Property Value

bool

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

EventHandlingStrategy

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

bool

MouseCursorType

Gets or sets the current mouse cursor type displayed.

public static MouseCursorType MouseCursorType { get; set; }

Property Value

MouseCursorType

MouseInfoGetter

Gets or sets the function used to retrieve the current mouse information.

public static Func<MouseInfo> MouseInfoGetter { get; set; }

Property Value

Func<MouseInfo>

RepeatKeyDownInternalInMs

Gets or sets the interval in milliseconds between key repeat events. Defaults to 50.

public static int RepeatKeyDownInternalInMs { get; set; }

Property Value

int

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

int

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

bool

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

bool

TooltipCreator

Gets or sets the function used to create tooltip widgets.

public static Func<Widget, Widget> TooltipCreator { get; set; }

Property Value

Func<Widget, Widget>

TooltipDelayInMs

Gets or sets the delay in milliseconds before showing a tooltip.

public static int TooltipDelayInMs { get; set; }

Property Value

int

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

string

Methods

DefaultDownKeysGetter(bool[])

Gets which keyboard keys are currently pressed from the game instance.

public static void DefaultDownKeysGetter(bool[] keys)

Parameters

keys bool[]

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()