Skip to content

CharacterPicker Class

Displays the glyphs associated with a font and allows the user to select one.

C#
public class CharacterPicker : SurfaceViewer, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Inheritance objectControlBaseCompositeControlSurfaceViewer

Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

CharacterPicker(Color, Color, Color, IFont, int, int, int)

Section titled “CharacterPicker(Color, Color, Color, IFont, int, int, int)”

Creates a new character picker control.

C#
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, IFont characterFont, int visibleColumns, int visibleRows, int fontColumns)

foreground SadRogue.Primitives.Color
Foreground color of all the glyphs.

fill SadRogue.Primitives.Color
Background color of all the glyphs.

selectedCharacterColor SadRogue.Primitives.Color
The foreground color displayed on the selected glyph.

characterFont IFont
The font used to display the glyphs.

visibleColumns int
The number of columns to show. The control will be this wide plus 1.

visibleRows int
The number of rows to show. The control will be this high plus 1.

fontColumns int
How many columns are defined in the font file.

CharacterPicker(Color, Color, Color, SadFont, int, int)

Section titled “CharacterPicker(Color, Color, Color, SadFont, int, int)”

Creates a new picker control with the specified font.

C#
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, SadFont characterFont, int visibleColumns, int visibleRows)

foreground SadRogue.Primitives.Color
Foreground color of all the glyphs.

fill SadRogue.Primitives.Color
Background color of all the glyphs.

selectedCharacterColor SadRogue.Primitives.Color
The foreground color displayed on the selected glyph.

characterFont SadFont
The font used to display the glyphs.

visibleColumns int
The number of columns to show. The control will be this wide plus 1.

visibleRows int
The number of rows to show. The control will be this high plus 1.

When true, indicates that the control should use a mouse click to select a new character; otherwise false to indicate that just having the mouse down will select a new character.

C#
public bool UseFullClick { get; set; }

Gets the position of the previously selected character. Used by the theme.

C#
public Point OldCharacterLocation { get; }

Gets the position of the newly selected character. Used by the theme.

C#
public Point NewCharacterLocation { get; }

Gets or sets the mirror effect to apply in the theme.

C#
public Mirror MirrorSetting { get; set; }

When true, highlights the selected character with SelectedGlyphForeground when HighlightSelectedCharacterWithEffect is false;

C#
public bool HighlightSelectedCharacter { get; set; }

When true, uses SelectedGlyphEffect to highlight the character.

C#
public bool HighlightSelectedCharacterWithEffect { get; set; }

Gets the foreground color used when drawing the glyphs.

C#
public Color GlyphForeground { get; }

Gets the background color used when drawing the glyphs.

C#
public Color GlyphBackground { get; }

Gets the foreground color used when drawing the selected glyph.

C#
public Color SelectedGlyphForeground { get; }

Gets the effect to apply when drawing the selected glyph.

C#
public ICellEffect? SelectedGlyphEffect { get; set; }

Gets or sets the selected glyph character.

C#
public int SelectedCharacter { get; set; }

Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.

C#
protected override void OnMouseIn(ControlBase.ControlMouseState info)

info ControlBase.ControlMouseState

Called when the left mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineState() method.

C#
protected override void OnLeftMouseClicked(ControlBase.ControlMouseState info)

info ControlBase.ControlMouseState

Processes the mouse on each control hosted by this control.

C#
public override bool ProcessMouse(MouseScreenObjectState state)

state MouseScreenObjectState
The mouse state based on the parent screen object.

bool
true when a control processes the mouse; otherwise false.

Generates the surface to be used by this control. This method is called internally to assign the Surface property a value.

C#
protected override ICellSurface CreateControlSurface()

ICellSurface
A surface that should be assigned to the Surface property.

Updates each control hosted by this control.

C#
public override void UpdateAndRedraw(TimeSpan time)

time TimeSpan
The game frame time delta.

Raised when the SelectedCharacter property changes.

C#
public event EventHandler<ValueChangedEventArgs<int>>? SelectedCharacterChanged

EventHandler<ValueChangedEventArgs<int>>