CharacterPicker Class
Definition
Section titled “Definition”Displays the glyphs associated with a font and allows the user to select one.
public class CharacterPicker : SurfaceViewer, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerableInheritance object → ControlBase → CompositeControl → SurfaceViewer
Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable
Constructors
Section titled “Constructors”CharacterPicker(Color, Color, Color, IFont, int, int, int)
Section titled “CharacterPicker(Color, Color, Color, IFont, int, int, int)”Creates a new character picker control.
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, IFont characterFont, int visibleColumns, int visibleRows, int fontColumns)Parameters
Section titled “Parameters”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.
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, SadFont characterFont, int visibleColumns, int visibleRows)Parameters
Section titled “Parameters”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.
Properties
Section titled “Properties”UseFullClick
Section titled “UseFullClick”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.
public bool UseFullClick { get; set; }OldCharacterLocation
Section titled “OldCharacterLocation”Gets the position of the previously selected character. Used by the theme.
public Point OldCharacterLocation { get; }NewCharacterLocation
Section titled “NewCharacterLocation”Gets the position of the newly selected character. Used by the theme.
public Point NewCharacterLocation { get; }MirrorSetting
Section titled “MirrorSetting”Gets or sets the mirror effect to apply in the theme.
public Mirror MirrorSetting { get; set; }HighlightSelectedCharacter
Section titled “HighlightSelectedCharacter”When true, highlights the selected character with SelectedGlyphForeground when HighlightSelectedCharacterWithEffect is false;
public bool HighlightSelectedCharacter { get; set; }HighlightSelectedCharacterWithEffect
Section titled “HighlightSelectedCharacterWithEffect”When true, uses SelectedGlyphEffect to highlight the character.
public bool HighlightSelectedCharacterWithEffect { get; set; }GlyphForeground
Section titled “GlyphForeground”Gets the foreground color used when drawing the glyphs.
public Color GlyphForeground { get; }GlyphBackground
Section titled “GlyphBackground”Gets the background color used when drawing the glyphs.
public Color GlyphBackground { get; }SelectedGlyphForeground
Section titled “SelectedGlyphForeground”Gets the foreground color used when drawing the selected glyph.
public Color SelectedGlyphForeground { get; }SelectedGlyphEffect
Section titled “SelectedGlyphEffect”Gets the effect to apply when drawing the selected glyph.
public ICellEffect? SelectedGlyphEffect { get; set; }SelectedCharacter
Section titled “SelectedCharacter”Gets or sets the selected glyph character.
public int SelectedCharacter { get; set; }Methods
Section titled “Methods”OnMouseIn(ControlMouseState)
Section titled “OnMouseIn(ControlMouseState)”Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.
protected override void OnMouseIn(ControlBase.ControlMouseState info)Parameters
Section titled “Parameters”info ControlBase.ControlMouseState
OnLeftMouseClicked(ControlMouseState)
Section titled “OnLeftMouseClicked(ControlMouseState)”Called when the left mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineState() method.
protected override void OnLeftMouseClicked(ControlBase.ControlMouseState info)Parameters
Section titled “Parameters”info ControlBase.ControlMouseState
ProcessMouse(MouseScreenObjectState)
Section titled “ProcessMouse(MouseScreenObjectState)”Processes the mouse on each control hosted by this control.
public override bool ProcessMouse(MouseScreenObjectState state)Parameters
Section titled “Parameters”state MouseScreenObjectState
The mouse state based on the parent screen object.
Returns
Section titled “Returns”bool
true when a control processes the mouse; otherwise false.
CreateControlSurface()
Section titled “CreateControlSurface()”Generates the surface to be used by this control. This method is called internally to assign the Surface property a value.
protected override ICellSurface CreateControlSurface()Returns
Section titled “Returns”ICellSurface
A surface that should be assigned to the Surface property.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Updates each control hosted by this control.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The game frame time delta.
Events
Section titled “Events”SelectedCharacterChanged
Section titled “SelectedCharacterChanged”Raised when the SelectedCharacter property changes.
public event EventHandler<ValueChangedEventArgs<int>>? SelectedCharacterChanged