ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
Loading...
Searching...
No Matches
ToyMaker::IUIElement Class Referenceabstract

Interface for a single UI element. More...

#include <ui_container.hpp>

Inheritance diagram for ToyMaker::IUIElement:
ToyMaker::UIButton ToyMaker::UIImage ToyMaker::UIPanel ToyMaker::UIText

Public Member Functions

virtual glm::vec2 getReferenceCoordinate () const =0
 Returns the reference coordinate on the container relative to which this element's offsets are defined.
virtual glm::vec3 getOffsets () const =0
 Returns the offsets relative to the container reference coordinates used to position this element's anchor.
virtual bool allowsDescendantControl () const =0
 Whether the container is permitted to reposition this element's children.

Detailed Description

Interface for a single UI element.

See also
ToyMaker::UIContainer

@TODO: Improve reusability by actually having UI elements share certain data and instructions.

Member Function Documentation

◆ allowsDescendantControl()

virtual bool ToyMaker::IUIElement::allowsDescendantControl ( ) const
pure virtual

Whether the container is permitted to reposition this element's children.

Implemented in ToyMaker::UIButton, ToyMaker::UIImage, ToyMaker::UIPanel, and ToyMaker::UIText.

◆ getOffsets()

virtual glm::vec3 ToyMaker::IUIElement::getOffsets ( ) const
pure virtual

Returns the offsets relative to the container reference coordinates used to position this element's anchor.

See also
ToyMaker::UIContainer

Implemented in ToyMaker::UIButton, ToyMaker::UIImage, ToyMaker::UIPanel, and ToyMaker::UIText.

◆ getReferenceCoordinate()

virtual glm::vec2 ToyMaker::IUIElement::getReferenceCoordinate ( ) const
pure virtual

Returns the reference coordinate on the container relative to which this element's offsets are defined.

(0, 0) represents the top left hand corner of the container, while (1, 1) represents the bottom-right hand corner of the container.

See also
ToyMaker::UIContainer

Implemented in ToyMaker::UIButton, ToyMaker::UIImage, ToyMaker::UIPanel, and ToyMaker::UIText.


The documentation for this class was generated from the following file: