|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Canvas component for 2D game resolution management. More...
#include <Canvas.hpp>
Public Member Functions | |
| Canvas ()=default | |
Public Attributes | |
| glm::uvec2 | designResolution {1920, 1080} |
| Design resolution in pixels. | |
| f32 | pixelsPerUnit {100.0f} |
| World pixels per physics meter (e.g., 100 means 100px = 1 Box2D meter). | |
| CanvasScaleMode | scaleMode {CanvasScaleMode::FixedHeight} |
| Scaling mode for different screen resolutions. | |
| f32 | matchWidthOrHeight {0.5f} |
| Match factor for Match scale mode (0 = width, 1 = height). | |
| glm::vec4 | backgroundColor {0.0f, 0.0f, 0.0f, 1.0f} |
| Background color for letterbox/pillarbox areas. | |
| i32 | layer {0} |
| Sorting layer this canvas' UI belongs to, for Camera.cullingMask. Membership only — UI draw order comes from the tree, not from this. | |
Canvas component for 2D game resolution management.
Defines the design resolution and scaling behavior for 2D games. The Canvas works with the Camera component to ensure consistent rendering across different screen resolutions.
Workflow:
Definition at line 71 of file Canvas.hpp.
|
default |
| glm::vec4 esengine::ecs::Canvas::backgroundColor {0.0f, 0.0f, 0.0f, 1.0f} |
Background color for letterbox/pillarbox areas.
Definition at line 90 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().
| glm::uvec2 esengine::ecs::Canvas::designResolution {1920, 1080} |
Design resolution in pixels.
Definition at line 74 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().
| i32 esengine::ecs::Canvas::layer {0} |
Sorting layer this canvas' UI belongs to, for Camera.cullingMask. Membership only — UI draw order comes from the tree, not from this.
Definition at line 95 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().
| f32 esengine::ecs::Canvas::matchWidthOrHeight {0.5f} |
Match factor for Match scale mode (0 = width, 1 = height).
Definition at line 86 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().
| f32 esengine::ecs::Canvas::pixelsPerUnit {100.0f} |
World pixels per physics meter (e.g., 100 means 100px = 1 Box2D meter).
Definition at line 78 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().
| CanvasScaleMode esengine::ecs::Canvas::scaleMode {CanvasScaleMode::FixedHeight} |
Scaling mode for different screen resolutions.
Definition at line 82 of file Canvas.hpp.
Referenced by canvasApplyJS(), and canvasToJS().