Skip to content

TextField

namespace Griff.Scenes;
public sealed class TextField : Component

A box to type into: a player’s name, the address of a game to join. Click it (or pick it with the arrow keys and press Enter) and type; Enter or a click elsewhere finishes. It shows its Value in the entity’s Text.

This is a component: its saved properties are on its component page.

public bool IsFocused { get; }

True while typing goes into it.

public int MaxLength { get; set; }

The longest it can get.

public string? Placeholder { get; set; }

Shown, faded, while it’s empty, e.g. “Your name”.

public Vector2 Size { get; set; }

The clickable area, centered on the entity, in world units before its scale.

public TextFieldUse Use { get; set; }

What it’s for: a player name or an address it fills in (and remembers) for network games.

public string? Value { get; set; }

What’s typed in it.