Table of Contents

Class MonoGameTextInputService

Namespace
TileWorld.Engine.Hosting.MonoGame
Assembly
TileWorld.Engine.Hosting.MonoGame.dll

Collects committed text through the active MonoGame window text-input event stream.

public sealed class MonoGameTextInputService : ITextInputService, IDisposable
Inheritance
MonoGameTextInputService
Implements
Inherited Members

Constructors

MonoGameTextInputService(GameWindow)

Creates a text input service bound to a MonoGame game window.

public MonoGameTextInputService(GameWindow window)

Parameters

window GameWindow

The game window that will publish committed text input events.

Properties

CurrentText

Gets the current committed text buffer for the active request.

public string CurrentText { get; }

Property Value

string

IsRequestActive

Gets a value indicating whether a text input request is currently active.

public bool IsRequestActive { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

RequestTextAsync(TextInputRequest, CancellationToken)

Begins collecting text input and completes when the request is confirmed or canceled.

public Task<string> RequestTextAsync(TextInputRequest request, CancellationToken cancellationToken = default)

Parameters

request TextInputRequest

The parameters that describe the desired input session.

cancellationToken CancellationToken

A cancellation token that aborts the request when triggered.

Returns

Task<string>

A task that resolves to the confirmed text, or null when the request is canceled.