Class MlemPlatform.DesktopGl<T>
The MLEM DesktopGL platform, which is also compatible with other desktop distributions of MonoGame, like WindowsDX. This platform uses the built-in MonoGame TextInput event, which makes this listener work with any keyboard localization natively. This platform is initialized as follows:
MlemPlatform.Current = new MlemPlatform.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
public class MlemPlatform.DesktopGl<T> : MlemPlatform
Type Parameters
T
- Inheritance
-
MlemPlatform.DesktopGl<T>
- Inherited Members
Constructors
DesktopGl(Action<GameWindow, EventHandler<T>>)
Creates a new DesktopGL-based platform. See MlemPlatform.DesktopGl<T> class documentation for more detailed information.
public DesktopGl(Action<GameWindow, EventHandler<T>> addListener)
Parameters
addListener
Action<GameWindow, EventHandler<T>>The function that is used to add a text input listener.
Methods
AddTextInputListener(GameWindow, TextInputCallback)
Adds a text input listener to this platform, if supported. The supplied listener will be called whenever a character is input.
public override void AddTextInputListener(GameWindow window, MlemPlatform.TextInputCallback callback)
Parameters
window
GameWindowThe game's window
callback
MlemPlatform.TextInputCallbackThe callback that should be called whenever a character is pressed
OpenLinkOrFile(string)
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 override void OpenLinkOrFile(string link)
Parameters
link
string
OpenOnScreenKeyboard(string, string, string, bool)
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 override Task<string> OpenOnScreenKeyboard(string title, string description, string defaultText, bool usePasswordMode)
Parameters
title
stringTitle of the dialog box.
description
stringDescription of the dialog box.
defaultText
stringDefault text displayed in the input area.
usePasswordMode
boolIf password mode is enabled, the characters entered are not displayed.