MlemPlatform is a wrapper around some of MonoGame's platform-dependent behavior to allow for MLEM to stay platform-independent. See MlemPlatform.DesktopGl<T>, MlemPlatform.DesktopFna, MlemPlatform.Mobile and MlemPlatform.None for information on the specific platforms. The MLEM demos' main classes also make use of this functionality: https://github.com/Ellpeck/MLEM/blob/main/Demos.DesktopGL/Program.cs#L8 and https://github.com/Ellpeck/MLEM/blob/main/Demos.Android/Activity1.cs#L33.
public abstract class MlemPlatform
- Inherited Members
- Extension Methods
The current MLEM platform Set this value before starting your game if you want to use platform-dependent MLEM features.
public static MlemPlatform Current
Adds a text input listener to this platform, if supported. The supplied listener will be called whenever a character is input.
public abstract void AddTextInputListener(GameWindow window, MlemPlatform.TextInputCallback callback)
The game's window
The callback that should be called whenever a character is pressed
public static void EnsureExists()
A method that should be executed to open a link in the browser or a file explorer. This method is currently used only by MLEM.Ui's implementation of the LinkCode formatting code.
public abstract void OpenLinkOrFile(string link)
Opens the on-screen keyboard if one is required by the platform. Note that, if no on-screen keyboard is required, a null string should be returned.
public abstract Task<string> OpenOnScreenKeyboard(string title, string description, string defaultText, bool usePasswordMode)
Title of the dialog box.
Description of the dialog box.
Default text displayed in the input area.
If password mode is enabled, the characters entered are not displayed.