std::optional< std::reference_wrapper< T > > get_component() const noexcept
Get the first component of type T attached to this GameObject.
Definition gameObject.h:141
Scene & scene() const noexcept
Represents a point in 2D space.
Definition point.h:6
Represents a scene within the engine. A scene contains multiple GameObjects and manages their lifecyc...
Definition scene.h:19
Base class for interactive UI elements.
Definition ui_interactable.h:28
virtual void on_hover()
Event hook for when the element is hovered.
Definition ui_interactable.h:56
std::vector< std::function< void(UIInteractable &)> > on_hover_handlers_
Definition ui_interactable.h:102
std::vector< std::function< void(UIInteractable &)> > on_unhover_handlers_
Definition ui_interactable.h:103
virtual void on_unfocus()
Event hook for when the element loses focus.
Definition ui_interactable.h:86
virtual void on_unhover()
Event hook for when the element is unhovered.
Definition ui_interactable.h:61
void add_on_release(const std::function< void(UIInteractable &)> &handler)
void add_on_unhover(const std::function< void(UIInteractable &)> &handler)
UIInteractionState & state()
void add_on_press(const std::function< void(UIInteractable &)> &handler)
std::vector< std::function< void(UIInteractable &)> > on_press_handlers_
Definition ui_interactable.h:105
std::vector< std::function< void(UIInteractable &)> > on_release_handlers_
Definition ui_interactable.h:106
void add_on_focus(const std::function< void(UIInteractable &)> &handler)
UIInteractionState interaction_state_
Definition ui_interactable.h:100
UIInteractable(Scene &scene, float width, float height, Point pivot, Point anchor)
void update_interaction(float dt)
Update interaction state based on input.
void disable()
Disable the interactable element.
void enable()
Enable the interactable element.
const UIInteractionState & state() const
virtual void on_hold()
Event hook for when the element is held down.
Definition ui_interactable.h:76
std::vector< std::function< void(UIInteractable &)> > on_unfocus_handlers_
Definition ui_interactable.h:109
virtual void on_focus()
Event hook for when the element gains focus.
Definition ui_interactable.h:81
virtual void on_press()
Event hook for when the element is pressed.
Definition ui_interactable.h:66
std::vector< std::function< void(UIInteractable &)> > on_focus_handlers_
Definition ui_interactable.h:108
void add_on_hover(const std::function< void(UIInteractable &)> &handler)
virtual void on_release()
Event hook for when the element is released.
Definition ui_interactable.h:71
void add_on_unfocus(const std::function< void(UIInteractable &)> &handler)
bool in_range(const Point &mouse_pos) const
Base class for all UI objects.
Definition ui_object.h:16
Interaction state for UIInteractable elements.
Definition ui_interactable.h:13
bool held
Definition ui_interactable.h:16
bool pressed
Definition ui_interactable.h:15
bool focused
Definition ui_interactable.h:17
bool disabled
Definition ui_interactable.h:18
bool hovered
Definition ui_interactable.h:14