Table of Contents

Namespace MLEM.Misc

Classes

CollectionExtensions

A set of extensions for dealing with collections of various kinds

GenericDataHolder

Represents an object that can hold generic key-value based data. A lot of MLEM components extend this class to allow for users to add additional data to them easily. This IGenericDataHolder implemention uses an underlying Dictionary<TKey, TValue> that only keeps track of non-default values.

MlemPlatform

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, as well as the online documentation at https://mlem.ellpeck.de/articles/ui.html#text-input 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.

MlemPlatform.DesktopFna

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);
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);
MlemPlatform.Mobile

The MLEM platform for mobile platforms as well as consoles. This platform opens an on-screen keyboard using the Microsoft.Xna.Framework.Input KeyboardInput class on mobile devices. Additionally, it starts a new activity whenever OpenLinkOrFile(string) is called. This listener is initialized as follows in the game's Activity class:

MlemPlatform.Current = new MlemPlatform.Mobile(KeyboardInput.Show, l => this.StartActivity(new Intent(Intent.ActionView, Uri.Parse(l))));
MlemPlatform.None

A MLEM platform implementation that does nothing. This can be used if no platform-dependent code is required for the game.

Interfaces

IGenericDataHolder

Represents an object that can hold generic key-value based data. A lot of MLEM components extend this class to allow for users to add additional data to them easily.

Delegates

MlemPlatform.Mobile.OpenOnScreenKeyboardDelegate

A delegate method used for OpenOnScreenKeyboard(string, string, string, bool)

MlemPlatform.TextInputCallback

A delegate method that can be used for AddTextInputListener(GameWindow, TextInputCallback)