Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::Sprite Struct Reference

What an entity looks like. More...

#include <aegis2d/ecs/components.hpp>

Public Attributes

std::uint32_t texture = 0
 Texture of the resource manager (render::TextureId), 0 for a plain rectangle.
 
Vec2 size {}
 Size on screen, in logical pixels.
 
std::uint32_t frame = 0
 Frame of the texture's sprite sheet, 0 for the first (or only) frame.
 
std::int32_t layer = 0
 Drawing order: higher layers are drawn over lower ones.
 
Vec4 tint {1.0F, 1.0F, 1.0F, 1.0F}
 RGBA color multiplied with the texture, components in [0, 1]; opaque white keeps it unchanged.
 

Detailed Description

What an entity looks like.

Holds only plain data, so the server can create and send it without the render module; the client turns it into a render::Sprite centered on the entity's Transform.

Member Data Documentation

◆ frame

std::uint32_t aegis2d::ecs::Sprite::frame = 0

Frame of the texture's sprite sheet, 0 for the first (or only) frame.

◆ layer

std::int32_t aegis2d::ecs::Sprite::layer = 0

Drawing order: higher layers are drawn over lower ones.

◆ size

Vec2 aegis2d::ecs::Sprite::size {}

Size on screen, in logical pixels.

◆ texture

std::uint32_t aegis2d::ecs::Sprite::texture = 0

Texture of the resource manager (render::TextureId), 0 for a plain rectangle.

◆ tint

Vec4 aegis2d::ecs::Sprite::tint {1.0F, 1.0F, 1.0F, 1.0F}

RGBA color multiplied with the texture, components in [0, 1]; opaque white keeps it unchanged.


The documentation for this struct was generated from the following file: