No matching definitions.

ecs-raylib/components

src/ecs-raylib/components.tur

standard 2D components for raylib-driven games.

Since: E3

defopaque

Pos2

(Pos2)

entity position in 2D space.

Since: E3

defopaque

Vel2

(Vel2)

entity velocity in 2D space, same packing as Pos2 (units per second).

Since: E3

defopaque

Rot

(Rot)

entity rotation in radians, packed as int(angle * 1000).

Since: E3

defopaque

Radius

(Radius)

circle collider / render radius, packed as int(radius * 1000).

Since: E3

defn

pos2-make

(pos2-make [x : float y : float] :)

pack (x, y) floats into a Pos2 carrier.

Since: E3

defn

pos2-x

(pos2-x [p : Pos2] :)

extract the x coordinate from a Pos2.

Since: E3

defn

pos2-y

(pos2-y [p : Pos2] :)

extract the y coordinate from a Pos2.

Since: E3

defn

pos2-add!

(pos2-add! [p : Pos2 v : Vel2 dt : float] :)

(p + v*dt) as a new Pos2. Pure; "add!" is the convention

Since: E3

defn

vel2-make

(vel2-make [x : float y : float] :)

pack a velocity (units per second).

Since: E3

defn

vel2-x

(vel2-x [v : Vel2] :)

extract the x component of a Vel2.

Since: E3

defn

vel2-y

(vel2-y [v : Vel2] :)

extract the y component of a Vel2.

Since: E3

defn

rot-make

(rot-make [angle : float] :)

pack a rotation (radians) into a Rot carrier.

Since: E3

defn

radius-make

(radius-make [r : float] :)

pack a radius (world units) into a Radius carrier.

Since: E3

defn

radius-value

(radius-value [r : Radius] :)

extract the radius float from a Radius carrier.

Since: E3

defn

rot-value

(rot-value [r : Rot] :)

extract the angle (radians) from a Rot carrier.

Since: E3

defopaque

Tint

(Tint)

a raylib Color, used as an ECS component.

Since: E4

defn

tint-make

(tint-make [c : Color] :)

wrap a raylib Color as the Tint component.

defn

tint-color

(tint-color [t : Tint] :)

recover the raylib Color from a Tint.

defn

color-rgba

(color-rgba [c : Color] :)

access the raw raylib Color handle from a Color carrier.

Since: E3