Skip to content

Latest commit

 

History

History
187 lines (116 loc) · 4.26 KB

File metadata and controls

187 lines (116 loc) · 4.26 KB

Debugging

Color

RGBA Color

Fields:

  • r: float64 — Red component
  • g: float64 — Green component
  • b: float64 — Blue component
  • a: float64 — Alpha (opacity) component

ColoredVertex

Point + color

Fields:

  • position: Model::Vec2 — Position
  • color: Color — Color

DebugData

Data for debug rendering

One of:

  • PlacedText — Text

    Fields:

    • position: Model::Vec2 — Position
    • text: string — Text
    • alignment: Model::Vec2 — Alignment, separate for x and y. From 0 to 1. 0.5 - center alignment
    • size: float64 — Size
    • color: Color — Color
  • Circle — Circle

    Fields:

    • position: Model::Vec2 — Position of the center
    • radius: float64 — Radius
    • color: Color — Color
  • GradientCircle — Circle with gradient fill

    Fields:

    • position: Model::Vec2 — Position of the center
    • radius: float64 — Radius
    • inner_color: Color — Color of the center
    • outer_color: Color — Color of the edge
  • Ring — Ring

    Fields:

    • position: Model::Vec2 — Position of the center
    • radius: float64 — Radius
    • width: float64 — Width
    • color: Color — Color
  • Pie — Sector of a circle

    Fields:

    • position: Model::Vec2 — Position of the center
    • radius: float64 — Radius
    • start_angle: float64 — Start angle
    • end_angle: float64 — End angle
    • color: Color — Color
  • Arc — Arc

    Fields:

    • position: Model::Vec2 — Position of the center
    • radius: float64 — Radius
    • width: float64 — Width
    • start_angle: float64 — Start angle
    • end_angle: float64 — End angle
    • color: Color — Color
  • Rect — Rectancle

    Fields:

    • bottom_left: Model::Vec2 — Bottom left position
    • size: Model::Vec2 — Size
    • color: Color — Color
  • Polygon — Polygon (convex)

    Fields:

    • vertices: [Model::Vec2] — Positions of vertices in order
    • color: Color — Color
  • GradientPolygon — Polygon with gradient fill

    Fields:

    • vertices: [ColoredVertex] — List of vertices in order
  • Segment — Segment

    Fields:

    • first_end: Model::Vec2 — Position of the first end
    • second_end: Model::Vec2 — Position of the second end
    • width: float64 — Width
    • color: Color — Color
  • GradientSegment — Segment with gradient fill

    Fields:

    • first_end: Model::Vec2 — Position of the first end
    • first_color: Color — Color of the first end
    • second_end: Model::Vec2 — Position of the second end
    • second_color: Color — Color of the second end
    • width: float64 — Width
  • PolyLine — Poly line

    Fields:

    • vertices: [Model::Vec2] — List of points in order
    • width: float64 — Width
    • color: Color — Color
  • GradientPolyLine — Poly line with gradient fill

    Fields:

    • vertices: [ColoredVertex] — List of points and colors in order
    • width: float64 — Width

DebugCommand

Debug commands that can be sent while debugging with the app

One of:

  • Add — Add debug data to current tick

    Fields:

    • debug_data: DebugData — Data to add
  • Clear — Clear current tick's debug data

    No fields

  • SetAutoFlush — Enable/disable auto performing of commands

    Fields:

    • enable: boolean — Enable/disable autoflush
  • Flush — Perform all previously sent commands

    No fields

Camera

Camera state

Fields:

  • center: Model::Vec2 — Center
  • rotation: float64 — Rotation
  • attack: float64 — Attack angle
  • fov: float64 — Vertical field of view

DebugState

Renderer's state

Fields:

  • pressed_keys: [string] — Pressed keys
  • cursor_world_position: Model::Vec2 — Cursor's position in game coordinates
  • locked_unit: Option<int32> — Id of unit which is followed by the camera, or None
  • camera: Camera — Current camera state