template<class ... Layers>
Magnum::Ui::BasicPlane class

Base for planes.

Each plane instance contains widgets on the same Z index and consists of layers from which the widgets are made of. The order of layers denotes the drawing order, first layer is drawn first.

Plane hierarchy

The user interface has a concept of active planes. Only one plane can be active at a time. If a plane is active, it's receiving user input and is displayed in front of all other inactive planes. Initially the UI has no planes, meaning that BasicUserInterface::activePlane() is returning nullptr. Adding first plane to an UI will make it active. If there already is an active plane, adding more planes to the UI will not change the active plane and the newly added planes are added as hidden. Calling hide() on a currently active plane will make the previous plane active (if there is any) and the plane is hidden. Calling activate() on an inactive plane will bring it to the front, make it receive input events and show it in case it was hidden.

Destroying a plane that's currently currently active makes the previous plane active, otherwise it's just removed from the plane hierarchy.

Base classes

class AbstractPlane
Non-templated base for planes.

Constructors, destructors, conversion operators

BasicPlane(BasicUserInterface<Layers...>& ui, const Anchor& anchor, const Range2D& padding, const Vector2& margin, Layers&... layers) explicit
Constructor.

Public functions

auto ui() -> BasicUserInterface<Layers...>&
User interface this plane is part of.
auto ui() const -> const BasicUserInterface<Layers...>&
auto previousActivePlane() -> BasicPlane<Layers...>*
Previous active plane.
auto previousActivePlane() const -> const BasicPlane<Layers...>*
auto nextActivePlane() -> BasicPlane<Layers...>*
Next active plane.
auto nextActivePlane() const -> const BasicPlane<Layers...>*
void update()
Update a plane.

Function documentation

template<class ... Layers>
Magnum::Ui::BasicPlane<Layers>::BasicPlane(BasicUserInterface<Layers...>& ui, const Anchor& anchor, const Range2D& padding, const Vector2& margin, Layers&... layers) explicit

Constructor.

Parameters
ui User interface this plane is part of
anchor Positioning anchor
padding Padding for widgets inside
margin Margin between the widgets inside
layers Layers the widgets on this plane are made of

If ui doesn't have any active plane yet, this plane is set as active. Otherwise the active plane is unchanged and this plane is added as hidden.

template<class ... Layers>
const BasicUserInterface<Layers...>& Magnum::Ui::BasicPlane<Layers>::ui() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class ... Layers>
BasicPlane<Layers...>* Magnum::Ui::BasicPlane<Layers>::previousActivePlane()

Previous active plane.

See AbstractPlane::previousActivePlane() for more information.

template<class ... Layers>
const BasicPlane<Layers...>* Magnum::Ui::BasicPlane<Layers>::previousActivePlane() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class ... Layers>
BasicPlane<Layers...>* Magnum::Ui::BasicPlane<Layers>::nextActivePlane()

Next active plane.

See AbstractPlane::nextActivePlane() for more information.

template<class ... Layers>
const BasicPlane<Layers...>* Magnum::Ui::BasicPlane<Layers>::nextActivePlane() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class ... Layers>
void Magnum::Ui::BasicPlane<Layers>::update()

Update a plane.

Calls Basic*Layer::update() on all layers in the plane. Called automatically at the beginning of BasicUserInterface::draw(), but scheduling it explicitly in a different place might reduce the need for CPU/GPU synchronization.