Event payload for entity interactions. More...
#include <canvas_events.h>
Public Types | |
| enum class | Type { kNone , kHover , kClick , kDoubleClick , kDragStart , kDragMove , kDragEnd } |
Public Member Functions | |
| void | Reset () |
| bool | IsDragEvent () const |
| Check if this is a drag event. | |
| bool | IsClickEvent () const |
| Check if this is a click event. | |
Public Attributes | |
| Type | type = Type::kNone |
| Type of interaction. | |
| int | entity_id = -1 |
| Entity being interacted with. | |
| ImVec2 | position |
| Current entity position (canvas coords) | |
| ImVec2 | delta |
| Movement delta (for drag events) | |
| ImVec2 | grid_position |
| Grid-aligned position. | |
| bool | is_valid = false |
| True if event is valid. | |
Event payload for entity interactions.
Represents various entity interaction events (hover, click, drag). Used for exits, entrances, sprites, items, etc.
Definition at line 85 of file canvas_events.h.
|
strong |
Definition at line 86 of file canvas_events.h.
|
inline |
Definition at line 103 of file canvas_events.h.
References delta, entity_id, grid_position, is_valid, kNone, position, and type.
Referenced by yaze::gui::CanvasInteractionEvents::Reset().
|
inline |
Check if this is a drag event.
Definition at line 113 of file canvas_events.h.
References kDragEnd, kDragMove, kDragStart, and type.
|
inline |
Check if this is a click event.
Definition at line 119 of file canvas_events.h.
References kClick, kDoubleClick, and type.
| Type yaze::gui::EntityInteractionEvent::type = Type::kNone |
Type of interaction.
Definition at line 96 of file canvas_events.h.
Referenced by IsClickEvent(), IsDragEvent(), and Reset().
| int yaze::gui::EntityInteractionEvent::entity_id = -1 |
Entity being interacted with.
Definition at line 97 of file canvas_events.h.
Referenced by yaze::gui::HandleEntityInteraction(), and Reset().
| ImVec2 yaze::gui::EntityInteractionEvent::position |
Current entity position (canvas coords)
Definition at line 98 of file canvas_events.h.
Referenced by Reset().
| ImVec2 yaze::gui::EntityInteractionEvent::delta |
Movement delta (for drag events)
Definition at line 99 of file canvas_events.h.
Referenced by Reset().
| ImVec2 yaze::gui::EntityInteractionEvent::grid_position |
| bool yaze::gui::EntityInteractionEvent::is_valid = false |
True if event is valid.
Definition at line 101 of file canvas_events.h.
Referenced by yaze::gui::CanvasInteractionEvents::HasAnyEvent(), and Reset().