RmlContext

Summary

Remarks

Danger

All calls made within this class MUST be performed on the Master Thread. See Threads.RunLater on how to safely call this from an asynchronous thread. Failure to comply with this can cause catastrophical failures as the engine is not designed for this.

Important

This class MUST be disposed manually.

Definition

Namespace: SDT4.Managed.UI.Rml
Assembly: SDT4.Managed.UI.dll

sealed class RmlContext
Inheritance:

Object ➔ RmlContext

Implements:

IDisposable

Fields

Name Type Description

Properties

Name Type Description
public get; Contexts RmlContext[] Returns an array of active contexts
public get; set; Dpi Single Gets/sets the ratio between the dp/px size
public get; LoadedDocuments RmlDocument[] Retrieves all currently loaded documents
public get; DataModels RmlDataModel[] Retrieves all currently instantiated data models
public get; ThemeQuery RmlThemeQuery The theme query associated with this context
public get; protected set; Name String

Methods

public static RmlContext CreateContext(String name, ViewportRenderInstance viewport)

Summary: Creates a new RmlUi context, with a given name. The name must be unique!

Parameters:

Returns:


public Void AttachToViewport(ViewportRenderInstance viewport)

Summary: Attaches this context to a new viewport. The old viewport is automatically detached. If the viewport is the same as the current, the operation does nothing.

Parameters:


public Void ForceUpdate()

Summary: Immediately attempts to update the context.

Remarks:

Important

It is rare appropriate that this needs to be called. Every frame, contexts get updated automatically. This method is mainly here to aid unit testing.


public T CreateDataModel<T>(String name)

Summary: Retrieves the data model instantiated for this context

Parameters:

Returns:


public Void DestroyDataModel(RmlDataModel dataModel)

Summary: Destroys the data model A data model to destroy.

Parameters:


public RmlDocument? LoadDocument(AssetId document)

Parameters:

Returns:


public Void DestroyDocument(RmlDocument document)

Summary: Removes the document from the UI. The document will be disposed!

Parameters:


public Boolean ProcessKeyDown(Int32 keyIdentifier, Int32 keyModifierState)

Summary: Sends a key down event into this context.

Parameters:

Returns:


public Boolean ProcessKeyUp(Int32 keyIdentifier, Int32 keyModifierState)

Summary: Sends a key up event into this context.

Parameters:

Returns:


public Boolean ProcessTextInput(Rune unicode)

Summary: Sends a single Unicode character as text input into this context.

Parameters:

Returns:


public Boolean ProcessTextInput(Char character)

Summary: Sends a single ASCII character as text input into this context.

Parameters:

Returns:


public Boolean ProcessTextInput(String text)

Summary: Sends a string of text as text input into this context.

Parameters:

Returns:


public Boolean ProcessMouseMove(Int32 x, Int32 y, Int32 keyModifierState)

Summary: Sends a mouse movement event into this context.

Parameters:

Returns:


public Boolean ProcessMouseButtonDown(Int32 buttonIndex, Int32 keyModifierState)

Summary: Sends a mouse-button down event into this context.

Parameters:

Returns:


public Boolean ProcessMouseButtonUp(Int32 buttonIndex, Int32 keyModifierState)

Summary: Sends a mouse-button up event into this context.

Parameters:

Returns:


public Boolean ProcessMouseWheel(Vector2d wheelDelta, Int32 keyModifierState)

Summary: Sends a mousescroll event into this context, and scrolls the document unless the event was stopped from propagating.

Parameters:

Returns:


public Boolean ProcessMouseLeave()

Summary: Tells the context the mouse has left the window.

Remarks: This removes any hover state from all elements and prevents Update() from setting the hover state for elements under the mouse. The mouse is considered activated again after the next call to RmlContext.ProcessMouseMove.

Returns:


public Void SubscribeToWindow(Window window)

Summary: Subscribes the input processors to the window event listener

Parameters:


public Void UnsubscribeFromWindow(Window window)

Summary: Unsubscribes the input processors from the window event listener

Parameters:


public virtual String ToString()

Returns:


public virtual Int32 GetHashCode()

Returns:


public virtual Boolean Equals(Object? obj)

Parameters:

Returns:


public Void Dispose()