src/boids_simpkg/ui/types

Search:
Group by:

Types

Ui = ref object
  widgets*: seq[Widget]
  showSettings*: bool
  settingsContent*: seq[Widget]
Widget = ref object
  pos*: Vector2
  size*: Vector2
  bgColor*, textColor*, borderColor*: Color
  case kind*: WidgetKind
  of Text, TextField:
      text*: string

  of Button, ToggleButton:
      buttonText*: string
      isBeingClicked*: bool = false
      onClick*: proc (ui: Ui)
      onRelease*: proc (ui: Ui)

  of Slider:
      name*: string
      isBeingChanged*: bool
      high*, low*, value*: float
      showName*, showValue*: bool
      fillColor*: Color

  
WidgetKind = enum
  Text, Button, ToggleButton, TextField, Slider