Class MultipleTuiScreenInteractive
- Namespace
- AshConsoleGraphics.Interactive
- Assembly
- AshConsoleGraphics.dll
Screen aimed at handling having multiple interactive screens at the same time, and only controlling one
public class MultipleTuiScreenInteractive : TuiScreen, IEnumerable<TuiElement>, IEnumerable
- Inheritance
-
MultipleTuiScreenInteractive
- Implements
- Inherited Members
Constructors
MultipleTuiScreenInteractive(int, int, IEnumerable<TuiScreenInteractive>, Placement, int, int, CharFormat?, params TuiElement[])
Initializes a new instance of a MultipleTuiScreenInteractive screen. Note that it starts with no selected screen
public MultipleTuiScreenInteractive(int xs, int ys, IEnumerable<TuiScreenInteractive> ss, Placement p, int x, int y, CharFormat? f, params TuiElement[] e)
Parameters
xsintThe x size
ysintThe y size
ssIEnumerable<TuiScreenInteractive>All the interactive screens
pPlacementxintyintfCharFormatThe default format
eTuiElement[]Additional elements
MultipleTuiScreenInteractive(int, int, IEnumerable<TuiScreenInteractive>, CharFormat?, params TuiElement[])
Initializes a new instance of a MultipleTuiScreenInteractive screen. Note that it starts with no selected screen
public MultipleTuiScreenInteractive(int xs, int ys, IEnumerable<TuiScreenInteractive> ss, CharFormat? f, params TuiElement[] e)
Parameters
xsintThe x size
ysintThe y size
ssIEnumerable<TuiScreenInteractive>All the interactive screens
fCharFormatThe default format
eTuiElement[]Additional elements
Fields
OnFinishPlayCycle
Event called at the end of each play cycle
public EventHandler OnFinishPlayCycle
Field Value
WaitForKey
If the screen will wait for a key press before updating
public bool WaitForKey
Field Value
Properties
KeyFunctions
The key actions
public Dictionary<(ConsoleKey, ConsoleModifiers), Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>> KeyFunctions { get; }
Property Value
Playing
If this screen is playing
public bool Playing { get; }
Property Value
ScreenList
All the interactive screens
public ReactiveList<TuiScreenInteractive> ScreenList { get; }
Property Value
- ReactiveList<TuiScreenInteractive>
SelectedScreen
The curently selected screen
public TuiScreenInteractive SelectedScreen { get; set; }
Property Value
Methods
DeleteAllKeyEvents()
Clears all existent key events and returns itself
public MultipleTuiScreenInteractive DeleteAllKeyEvents()
Returns
HandleKey(ConsoleKeyInfo)
Handle a key press
public bool HandleKey(ConsoleKeyInfo keyInfo)
Parameters
keyInfoConsoleKeyInfo
Returns
Play()
Plays the interactive screen. Handles all key presses
public void Play()
StopPlaying(MultipleTuiScreenInteractive, ConsoleKeyInfo)
Stop a screen playing
public static void StopPlaying(MultipleTuiScreenInteractive s, ConsoleKeyInfo ck)
Parameters
SubKeyEvent(ConsoleKey, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>)
Adds a new key event with no modifiers and returns itself
public MultipleTuiScreenInteractive SubKeyEvent(ConsoleKey k, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo> keyFunction)
Parameters
kConsoleKeykeyFunctionAction<MultipleTuiScreenInteractive, ConsoleKeyInfo>
Returns
SubKeyEvent(ConsoleKey, ConsoleModifiers, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo>)
Adds a new key event and returns itself
public MultipleTuiScreenInteractive SubKeyEvent(ConsoleKey k, ConsoleModifiers m, Action<MultipleTuiScreenInteractive, ConsoleKeyInfo> keyFunction)
Parameters
kConsoleKeymConsoleModifierskeyFunctionAction<MultipleTuiScreenInteractive, ConsoleKeyInfo>