|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Turns this entity's Sprite into a stencil the sprites drawn after it can be cut by. More...
Go to the source code of this file.
Classes | |
| struct | esengine::ecs::SpriteMask |
| A stencil cut from this entity's own Sprite. More... | |
Namespaces | |
| namespace | esengine |
| namespace | esengine::ecs |
Turns this entity's Sprite into a stencil the sprites drawn after it can be cut by.
The mask is a SPRITE, not a shape of its own: the same entity's Sprite supplies the texture, size, pivot, flips and 9-slice, and is drawn with colour writes off. A second geometry field would be a second thing to keep in step with what the author sees, and there is nothing a mask needs that a sprite cannot already say.
Reach is a RANGE, not a subtree. What a 2D mask cuts is rarely its own children — a hole in a fog layer is drawn over scenery that belongs to no part of it — so the mask reaches the sprites drawn after it, which is the order the author already arranges by layer and order. UIMask keeps the subtree rule, because a UI tree IS its containment.
Definition in file SpriteMask.hpp.