Information for the ui elements ###
Types
BottomRow {.pure.} = enum NumTriangles = 4, ViewRadius, EvadeEdges, MinSpeed, MaxSpeed
SliderInfo = tuple[name: string, start, min, max: float]
TopRow {.pure.} = enum Separation, Alignment, Cohesion, ProtectedZone
Vars
screenHeight = 900
screenWidth = 1800
Consts
bgColor = (r: 0'u, g: 0'u, b: 0'u, a: 255'u)
- Background color of all widgets
borderColor = (r: 255'u, g: 255'u, b: 255'u, a: 255'u)
- Border color of widgets with borders
bottom_row: array[BottomRow, SliderInfo] = [ ("Num Triangles", 600.0, 1.0, 2000.0), ("View Radius", 150.0, 0.0, 600.0), ("Evade Edges", 0.2, 0.0, 1.0), ("Min Speed", 250.0, 50.0, 1000.0), ("Max Speed", 400.0, 50.0, 1000.0)]
clicklessUiDefault = true
- Toggle clickless UI. If on, sliders will be updated on hover
debugModeDefault = false
- Toggle debug mode. Draws the view radius, protected zone and center of mass of one bird and enables the visualization of other debug values
Down = (x: 0.0, y: 1.0)
fillColor = (r: 0'u, g: 228'u, b: 48'u, a: 255'u)
- Fill color. Used in sliders only for the movable part
fontSize = 18
- Default font size in pixels
Left = (x: -1.0, y: 0.0)
margin = 20.0
pictureModeDefault = false
- Toggle picture mode alias "Hide All". Hides all widgets. Can be reactivated on mouse click
Right = (x: 1.0, y: 0.0)
showSliderNameDefault = true
- Show the name of the sliders ("cohesion", "num triangles", etc.)
showSliderValueDefault = true
- Show the value of the sliders. If both name and value are on, it will be shown in the format name: value
textColor = (r: 255'u, g: 255'u, b: 255'u, a: 255'u)
- Text color of all text
top_row: array[TopRow, SliderInfo] = [("Separation", 0.5, 0.0, 1.0), ("Alignment", 0.5, 0.0, 1.0), ("Cohesion", 0.5, 0.0, 1.0), ("Protected Zone", 70.0, 0.0, 200.0)]
triangleSize = (x: 12.0, y: 25.0)
Up = (x: 0.0, y: -1.0)
Procs
proc defaultButtonSize(): Vector2 {....raises: [], tags: [], forbids: [].}
proc popupSize(): Vector2 {....raises: [], tags: [], forbids: [].}
proc popupTopLeft(): Vector2 {....raises: [], tags: [], forbids: [].}
proc settingsButtonPos(): Vector2 {....raises: [], tags: [], forbids: [].}
proc settingsButtonSize(): Vector2 {....raises: [], tags: [], forbids: [].}
proc widgetHeight(): float {....raises: [], tags: [], forbids: [].}
- Current widget width
proc widgetWidth(): float {....raises: [], tags: [], forbids: [].}
- Current widget height (relative to screen width)