84 ES_PROPERTY(animatable, tooltip=
"Tint multiplied into the texture (white = unchanged).")
85 glm::vec4
color{1.0f, 1.0f, 1.0f, 1.0f};
89 glm::vec2
size{1.0f, 1.0f};
92 ES_PROPERTY(normalized_of=size, tooltip=
"Anchor point the sprite rotates and scales about, as a fraction of its size (0.5,0.5 = centre). Values outside 0–1 sit off the sprite.")
104 ES_PROPERTY(step=1, enum_source=sortingLayers, tooltip=
"Sorting layer — controls draw order across sprites.")
110 ES_PROPERTY(step=1, min=-128, max=127, optional, tooltip=
"Draw order inside the sorting layer — higher draws on top. Overrides the layer's Y-sort or depth ordering; leave 0 to keep it.")
116 tooltip=
"Whether a SpriteMask drawn before this sprite clips it, and which side survives.")
120 ES_PROPERTY(tooltip=
"Receive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this.")
134 tooltip=
"Draw mode: Auto infers from tile size and the texture's 9-slice border; the others override it.")
149 ES_PROPERTY(advanced, tooltip=
"Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).")
153 ES_PROPERTY(asset = material, category=Materials, tooltip=
"The material it is drawn with; none draws it with the built-in sprite look.")
Type-safe resource handle system.
Math utilities and GLM configuration for ESEngine.
Reflection and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_ENUM(...)
Mark an enum that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
SpriteMaskInteraction
2D sprite component for rendering
@ VisibleInside
Drawn only where the mask is — a window.
@ VisibleOutside
Drawn only where the mask is NOT — a hole.
@ None
Masks reaching this sprite are ignored.
SpriteDrawMode
How a Sprite fills its box.
Handle< esengine::Texture > TextureHandle
Handle to a texture resource.
std::int32_t i32
Signed 32-bit integer.
std::uint32_t u32
Unsigned 32-bit integer.
std::uint8_t u8
Unsigned 8-bit integer.
bool flipY
Flip sprite vertically.
glm::vec2 uvOffset
UV coordinate offset for sprite sheets.
i32 maskInteraction
What a SpriteMask drawn before this sprite does to it. Opt-in, so a mask added to a scene cannot make...
glm::vec2 parallax
Parallax scroll factor per axis. 1 = moves with the world (default, no parallax); <1 = scrolls slower...
SpriteDrawMode drawMode
How this sprite fills its box; Auto infers it from tileSize and the texture's slice border.
glm::vec2 uvScale
UV coordinate scale for sprite sheets.
bool lit
Lit by the scene's 2D lights (Light), no material needed. Off = unlit.
bool flipX
Flip sprite horizontally.
i32 layer
Sorting layer (higher = rendered on top).
Sprite(resource::TextureHandle tex, const glm::vec4 &col)
Constructs sprite with texture and color tint.
glm::vec2 size
Sprite size in world units ({1,1} at runtime; authored at 100px).
Sprite(resource::TextureHandle tex)
Constructs sprite with texture handle.
resource::TextureHandle texture
Texture resource handle (type-safe).
i32 order
Order WITHIN the sorting layer; higher draws on top. The explicit answer that overrides whatever the ...
u32 material
Custom material ID (0 = use default batch shader).
glm::vec2 tileSize
Tile size in world units for tiling mode ({0,0} = no tiling).
glm::vec4 color
Color tint (RGBA, 0-1 range).
glm::vec2 pivot
Pivot point (0,0 = bottom-left, 0.5,0.5 = center, 1,1 = top-right).
Sprite()=default
Default constructor (white, no texture).
glm::vec2 tileSpacing
Spacing between tiles in world units ({0,0} = seamless).