public override void Draw(CompactGraphics g, Input.inpuT input) { if (isIteractable) { inputAction(input); } else { action(); } }
/// <summary> /// Updates and adds all the current widgets to the frame, passing user input. /// </summary> /// <param name="input">The current user input value</param> public virtual void StepFrame(Input.inpuT input) { foreach (Widget widget in onPage) { if (widget.Selected) { widget.Draw(g, input); } else { widget.Draw(g); } } }
/// <summary> /// Update the text entry with a key input then draw to the screen buffer. /// </summary> /// <param name="g"></param> /// <param name="keyInfo"></param> public override void Draw(CompactGraphics g, Input.inpuT keyInfo) { if (keyInfo.key != ConsoleKey.Backspace) { text += keyInfo.KeyChar; } else if (keyInfo.key == ConsoleKey.Backspace) { if (text.Length > 0) { text = text.Remove(text.Length - 1); } } Draw(g); }
public override void Draw(CompactGraphics g, Input.inpuT mouse) { if (Bounds.Overlaps(mouse.MouseX, mouse.MouseY)) { switch (mouse.buttonState) { case 0: tempback = hover_color; if (mouseDown == 1) { OnClick(mouse); } mouseDown = 0; break; case 1 when mouseDown == 0 || mouseDown == 1: tempback = ClickColor; mouseDown = 1; break; default: tempback = backColor; mouseDown = 0; break; } } else { tempback = backColor; } for (int i = 0; i < lines.Count; i++) { if (Bounds.y1 + i < Bounds.y2) { g.Draw(lines[i], tempfor, Bounds.x1, Bounds.y1 + i); g.DrawBGRectangle(tempback, Bounds.x1, Bounds.x2 - 1, Bounds.y1 + i, Bounds.y1 + i); } } }
public void Step(Input.inpuT userInput) { }