4#include "UIComponentType.h"
78 UIComponentType
Type = UIComponentType::None;
82 friend class UIAttorney;
A UI container for managing and rendering UI components.
Definition Canvas.h:29
Abstract base class for all UI components.
Definition UIComponent.h:32
void SetOwningCanvas(Canvas *canvas)
Gets the owning canvas of the component.
Definition UIComponent.h:73
int Layer
Rendering layer in.
Definition UIComponent.h:77
virtual bool IsMouseOver(float xPos, float yPos)=0
Checks if the mouse is over the component. Must be implemented by derived classes.
virtual void SetLayer(int layer)
Sets the rendering layer of the component.
Definition UIComponent.cpp:4
UIComponentType Type
Type of the UI component.
Definition UIComponent.h:78
bool Enabled
Indicates if the component is enabled or not.
Definition UIComponent.h:76
UIComponentType GetType() const
Gets the type of the UI component.
Definition UIComponent.h:55
Canvas * pOwningCanvas
Pointer to the owning canvas, if any.
Definition UIComponent.h:79
int GetLayer() const
Gets the rendering layer of the component.
Definition UIComponent.h:43
virtual void Render()=0
Renders the UI component. Must be implemented by derived classes.
virtual ~UIComponent()=default
Virtual destructor.
bool IsEnabled() const
Returns whether the component is enabled or not.
Definition UIComponent.h:61
virtual void OnPress()=0
Handles press events on the component. Must be implemented by derived classes.
void SetEnabled(bool enabled)
Sets the enabled state of the component.
Definition UIComponent.h:67