ecs-raylib/components
standard 2D components for raylib-driven games.
Since: E3
Pos2
(Pos2)
entity position in 2D space.
Since: E3
Vel2
(Vel2)
entity velocity in 2D space, same packing as Pos2 (units per second).
Since: E3
Rot
(Rot)
entity rotation in radians, packed as int(angle * 1000).
Since: E3
Radius
(Radius)
circle collider / render radius, packed as int(radius * 1000).
Since: E3
pos2-make
(pos2-make [x : float y : float] :)
pack (x, y) floats into a Pos2 carrier.
Since: E3
pos2-x
(pos2-x [p : Pos2] :)
extract the x coordinate from a Pos2.
Since: E3
pos2-y
(pos2-y [p : Pos2] :)
extract the y coordinate from a Pos2.
Since: E3
pos2-add!
(pos2-add! [p : Pos2 v : Vel2 dt : float] :)
(p + v*dt) as a new Pos2. Pure; "add!" is the convention
Since: E3
vel2-make
(vel2-make [x : float y : float] :)
pack a velocity (units per second).
Since: E3
vel2-x
(vel2-x [v : Vel2] :)
extract the x component of a Vel2.
Since: E3
vel2-y
(vel2-y [v : Vel2] :)
extract the y component of a Vel2.
Since: E3
rot-make
(rot-make [angle : float] :)
pack a rotation (radians) into a Rot carrier.
Since: E3
radius-make
(radius-make [r : float] :)
pack a radius (world units) into a Radius carrier.
Since: E3
radius-value
(radius-value [r : Radius] :)
extract the radius float from a Radius carrier.
Since: E3
rot-value
(rot-value [r : Rot] :)
extract the angle (radians) from a Rot carrier.
Since: E3
Tint
(Tint)
a raylib Color, used as an ECS component.
Since: E4
tint-make
(tint-make [c : Color] :)
wrap a raylib Color as the Tint component.
tint-color
(tint-color [t : Tint] :)
recover the raylib Color from a Tint.
color-rgba
(color-rgba [c : Color] :)
access the raw raylib Color handle from a Color carrier.
Since: E3