1#ifndef YAZE_APP_GUI_CANVAS_CANVAS_EVENTS_H
2#define YAZE_APP_GUI_CANVAS_CANVAS_EVENTS_H
5#include "imgui/imgui.h"
107 delta = ImVec2(0, 0);
Main namespace for the application.
Combined interaction result for a frame.
bool HasAnyEvent() const
Check if any event occurred.
TilePaintEvent tile_paint
RectSelectionEvent rect_selection
TileSelectionEvent tile_selection
EntityInteractionEvent entity_interaction
void Reset()
Reset all events.
Event payload for entity interactions.
int entity_id
Entity being interacted with.
bool IsDragEvent() const
Check if this is a drag event.
bool is_valid
True if event is valid.
@ kClick
Single click on entity.
@ kDoubleClick
Double click on entity.
@ kDragEnd
Finished dragging entity.
@ kHover
Mouse hovering over entity.
@ kDragStart
Started dragging entity.
@ kDragMove
Dragging entity (continuous)
ImVec2 position
Current entity position (canvas coords)
bool IsClickEvent() const
Check if this is a click event.
Type type
Type of interaction.
ImVec2 grid_position
Grid-aligned position.
ImVec2 delta
Movement delta (for drag events)
Event payload for hover preview.
bool is_valid
True if hovering over canvas.
ImVec2 position
Canvas-space hover position.
ImVec2 grid_position
Grid-aligned hover position.
Event payload for rectangle selection operations.
bool IsEmpty() const
Check if selection is empty.
bool is_complete
True when selection finishes.
int current_map
Map ID for coordinate calculation.
ImVec2 start_pos
Rectangle start (canvas coords)
std::vector< ImVec2 > selected_tiles
Individual tile positions (grid coords)
ImVec2 end_pos
Rectangle end (canvas coords)
size_t Count() const
Get number of selected tiles.
bool is_active
True while dragging.
Event payload for tile painting operations.
int tile_id
Tile ID being painted (-1 if none)
ImVec2 position
Canvas-space pixel coordinates.
bool is_complete
True when paint action finishes.
ImVec2 grid_position
Grid-aligned tile position.
bool is_drag
True for continuous drag painting.
Event payload for single tile selection.
int tile_id
Selected tile ID.
bool is_valid
True if selection is valid.
ImVec2 tile_position
Selected tile position (grid coords)