Struct Engine::Position¶
A basic component representing a 2D position (x, y) plus a draw layer (z). More...
#include <Position.hpp>
Public Attributes¶
| Type | Name |
|---|---|
| bool | moved True when (x, y, z) differs from (prevX, prevY, prevZ); updated by PositionSystem . |
| float | prevX |
| float | prevY |
| int | prevZ |
| bool | relative = falseWhen true and the entity has Parent ,HierarchySystem applies the parent's frame delta to this position. |
| float | x |
| float | y |
| int | z Draw layer: entities with a higher z are drawn on top of lower ones. |
Public Functions¶
| Type | Name |
|---|---|
| Position (float x=0.0f, float y=0.0f, int z=0) Creates a Position . Previous-frame coordinates start equal to the current ones so the entity is not reported as moved on spawn. |
Detailed Description¶
Holds current (x, y, z), previous-frame (prevX, prevY, prevZ), moved, and relative. Stored x/y are always world coordinates; relative only gates HierarchySystem delta follow.
Public Attributes Documentation¶
variable moved¶
True when (x, y, z) differs from (prevX, prevY, prevZ); updated by PositionSystem .
variable prevX¶
variable prevY¶
variable prevZ¶
variable relative¶
When true and the entity has Parent ,HierarchySystem applies the parent's frame delta to this position.
variable x¶
variable y¶
variable z¶
Draw layer: entities with a higher z are drawn on top of lower ones.
Public Functions Documentation¶
function Position¶
Creates a Position . Previous-frame coordinates start equal to the current ones so the entity is not reported as moved on spawn.
Parameters:
xThe initial X position.yThe initial Y position.zThe initial draw layer.
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Components/Position.hpp