5#include "../Inputable/Inputable.h"
6#include "../Drawable/Drawable.h"
7#include "../Updatable/Updatable.h"
28class Canvas :
public Drawable,
public Inputable,
public Updatable
32 Canvas(
const Canvas&) =
delete;
33 Canvas& operator=(
const Canvas&) =
delete;
61 friend class UIAttorney;
66 std::map<int, std::vector<UIComponent*>> layerMap;
68 std::map<UIComponent*, int> componentLayerLookup;
73 void OnComponentLayerChanged(
UIComponent* component,
int oldLayer,
int newLayer);
void Update() override
Updates the canvas and its child components. Called automatically by the engine each frame when regis...
Definition Canvas.cpp:100
void Draw2D() override
Draws the canvas and its child components. Called automatically by the engine each frame when registe...
Definition Canvas.cpp:106
void AddComponent(UIComponent *component)
Adds a UI component to the canvas.
Definition Canvas.cpp:22
void HandleMouseReleaseInput()
Handles released AZUL mouse input.
Definition Canvas.cpp:208
void SetEnabled(bool e)
Sets the canvas to be enabled or disabled.
Definition Canvas.cpp:59
std::vector< UIComponent * > components
List of UI components in this canvas.
Definition Canvas.h:63
void MouseHeld(AZUL_MOUSE m) override
Handles held AZUL mouse input. Called automatically by the engine when mouse input is detected.
Definition Canvas.cpp:129
void HandleHover()
Handles AZUL mouse hover input.
Definition Canvas.cpp:223
void MouseRelease(AZUL_MOUSE m) override
Handles released AZUL mouse input. Called automatically by the engine when mouse input is detected.
Definition Canvas.cpp:137
void MousePress(AZUL_MOUSE m) override
Handles pressed AZUL mouse input. Called automatically by the engine when mouse input is detected.
Definition Canvas.cpp:121
void HandleScroll()
Handles AZUL mouse scroll input.
Definition Canvas.cpp:186
void RemoveComponent(UIComponent *component)
Removes a UI component from the canvas.
Definition Canvas.cpp:34
void HandleMouseInput()
Handles AZUL mouse press/hover input.
Definition Canvas.cpp:145
bool IsEnabled() const
Returns whether the canvas is enabled or not.
Definition Canvas.cpp:81
void HandleHeldMouseInput()
Handles AZUL mouse scroll input.
Definition Canvas.cpp:167
Abstract base class for all UI components.
Definition UIComponent.h:32