Table of Contents

Class MlemPlatform.DesktopFna

Namespace
MLEM.Misc
Assembly
MLEM.dll

The MLEM Desktop platform for FNA. This platform uses the built-in FNA TextInputEXT event, which makes this listener work with any keyboard localization natively. This platform is initialized as follows:

MlemPlatform.Current = new MlemPlatform.DesktopFna(a => TextInputEXT.TextInput += a);
public class MlemPlatform.DesktopFna : MlemPlatform
Inheritance
MlemPlatform.DesktopFna
Inherited Members
Extension Methods

Constructors

DesktopFna(Action<Action<char>>)

Creates a new Desktop for FNA platform. See MlemPlatform.DesktopFna class documentation for more detailed information.

public DesktopFna(Action<Action<char>> addListener)

Parameters

addListener Action<Action<char>>

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 GameWindow

The game's window

callback MlemPlatform.TextInputCallback

The 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 string

Title of the dialog box.

description string

Description of the dialog box.

defaultText string

Default text displayed in the input area.

usePasswordMode bool

If password mode is enabled, the characters entered are not displayed.

Returns

Task<string>

Text entered by the player. Null if back was used.