23#include "guillaume/systems/clip.hpp"
36 _engine.clearScissor();
41 float height,
float margin)
45 rect.
x = pose.getPosition().getX() + margin;
46 rect.
y = pose.getPosition().getY() + margin;
47 rect.
width = width - 2.0f * margin;
48 rect.
height = height - 2.0f * margin;
62 if (!clip.isEnabled()) {
70 const auto rect =
computeRect(pose, bound.getWidth(), bound.getHeight(),
74 _engine.setScissor(utility::graphic::ScissorRect {
75 rect.x, rect.y, rect.width, rect.height });
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
SystemFiller(Phase phase)
ComponentType & getComponent(const ecs::Entity::Identifier &entityIdentifier)
Get a component of an entity from the bound registry, to read or modify it.
bool requireComponent(const ecs::Entity::Identifier &entityIdentifier)
Tell whether an entity has a component, and log a warning naming the entity and the component when it...
void update(const ecs::Entity::Identifier &entityIdentifier) override
Resolve the clip rectangle of one entity, store it in its components::Clip and make it the engine sci...
static components::Clip::Rect computeRect(const utility::graphic::PoseF &pose, float width, float height, float margin)
Compute a clip rectangle from the pose and size of a bound.
Clip(utility::Engine &engine)
Create the system in the Layout phase.
void prepare(void) override
Clear the engine scissor. Called once per frame before the entities are visited, so a frame without a...
Arranges the children of a container in a row or a column and sizes the container around them.
State. Every class here is plain data attached to an entity.
The entity-component-system core, independent of any widget.
Rules. Every class here runs each frame on the entities that have the components it declares.
The clip rectangle, in the same coordinates as the position of a components::Transform.
float height
Height, in dp.