SpriteComponent struct in Thread
A textured quad placed in the 3D world (as opposed to a screen-space UI image). Rendered
through the batched Renderer2D with the scene camera and depth-tested against
geometry. The texture is lazy-loaded from TexturePath at render time.
Properties
| TexturePath | std::string | Texture asset path (VFS). Empty = solid quad. |
| Color | Vec4 | Tint multiplied with the texture (alpha included). |
| Size | Vec2 | World-space width/height of the quad. |
| Mode | SpriteMode | Billboard (always faces camera) or Flat (entity's local XY plane). |
| Enabled | bool | Master switch. |
SpriteMode
| Billboard | enum | Always faces the camera — icons, health bars, impostors. |
| Flat | enum | Lies in the entity's local XY plane — 2D/2.5D, decals. |
Example
auto e = scene.CreateEntity("Icon");
auto& s = e.AddComponent<Thread::SpriteComponent>();
s.TexturePath = "assets/textures/marker.png";
s.Size = { 1.0f, 1.0f };
s.Mode = Thread::SpriteMode::Billboard;
For screen-space 2D, use the UI system (UIImage / UICanvas).
SpriteComponent struct w Thread
Teksturowany prostokąt umieszczony w świecie 3D (w odróżnieniu od obrazu UI na ekranie).
Renderowany przez wsadowy Renderer2D kamerą sceny, z testem głębi względem
geometrii. Tekstura wczytuje się leniwie z TexturePath przy renderowaniu.
Właściwości
| TexturePath | std::string | Ścieżka assetu tekstury (VFS). Pusta = jednolity prostokąt. |
| Color | Vec4 | Odcień mnożony przez teksturę (razem z alfą). |
| Size | Vec2 | Szerokość/wysokość prostokąta w świecie. |
| Mode | SpriteMode | Billboard (zawsze przodem do kamery) lub Flat (lokalna płaszczyzna XY encji). |
| Enabled | bool | Główny przełącznik. |
SpriteMode
| Billboard | enum | Zawsze przodem do kamery — ikony, paski zdrowia, impostory. |
| Flat | enum | Leży w lokalnej płaszczyźnie XY encji — 2D/2.5D, decale. |
Przykład
auto e = scene.CreateEntity("Icon");
auto& s = e.AddComponent<Thread::SpriteComponent>();
s.TexturePath = "assets/textures/marker.png";
s.Size = { 1.0f, 1.0f };
s.Mode = Thread::SpriteMode::Billboard;
Do 2D na ekranie użyj systemu UI (UIImage / UICanvas).