yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::EntityInteractionEvent Struct Reference

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.
 

Detailed Description

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.

Member Enumeration Documentation

◆ Type

Enumerator
kNone 

No interaction.

kHover 

Mouse hovering over entity.

kClick 

Single click on entity.

kDoubleClick 

Double click on entity.

kDragStart 

Started dragging entity.

kDragMove 

Dragging entity (continuous)

kDragEnd 

Finished dragging entity.

Definition at line 86 of file canvas_events.h.

Member Function Documentation

◆ Reset()

void yaze::gui::EntityInteractionEvent::Reset ( )
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().

◆ IsDragEvent()

bool yaze::gui::EntityInteractionEvent::IsDragEvent ( ) const
inline

Check if this is a drag event.

Definition at line 113 of file canvas_events.h.

References kDragEnd, kDragMove, kDragStart, and type.

◆ IsClickEvent()

bool yaze::gui::EntityInteractionEvent::IsClickEvent ( ) const
inline

Check if this is a click event.

Definition at line 119 of file canvas_events.h.

References kClick, kDoubleClick, and type.

Member Data Documentation

◆ 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().

◆ entity_id

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().

◆ position

ImVec2 yaze::gui::EntityInteractionEvent::position

Current entity position (canvas coords)

Definition at line 98 of file canvas_events.h.

Referenced by Reset().

◆ delta

ImVec2 yaze::gui::EntityInteractionEvent::delta

Movement delta (for drag events)

Definition at line 99 of file canvas_events.h.

Referenced by Reset().

◆ grid_position

ImVec2 yaze::gui::EntityInteractionEvent::grid_position

Grid-aligned position.

Definition at line 100 of file canvas_events.h.

Referenced by Reset().

◆ is_valid

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().


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