Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
SpriteDrawResolve.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
12#pragma once
13
15
16namespace esengine {
17
20 bool tiled{false};
21 bool nineSlice{false};
22};
23
32 bool hasTileSize,
33 bool hasSliceBorder) {
34 switch (mode) {
36 return {};
38 return {hasTileSize, false};
40 return {false, hasSliceBorder};
42 default:
43 return {hasTileSize, !hasTileSize && hasSliceBorder};
44 }
45}
46
47} // namespace esengine
2D sprite rendering component
SpriteDrawMode
How a Sprite fills its box.
Definition Sprite.hpp:43
constexpr SpriteDrawChoice resolveSpriteDraw(ecs::SpriteDrawMode mode, bool hasTileSize, bool hasSliceBorder)
Resolve the geometry from the author's mode and what the data offers.