yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::snapping Namespace Reference

Enumerations

enum class  GridType { Object , Sprite , Item , Door }
 Snapping grids for different dungeon elements. More...
 

Functions

int SnapToTile (int pixel)
 Snap a pixel coordinate to the 8px tile grid.
 
int SnapToGrid (int pixel, int grid_size)
 Snap a pixel coordinate to a specific grid size.
 
ImVec2 SnapToTileGrid (const ImVec2 &point)
 Snap a point to the 8px tile grid.
 
ImVec2 SnapToItemGrid (const ImVec2 &point)
 Snap a point for Pot Items (X: 4px, Y: 16px)
 
ImVec2 SnapToSpriteGrid (const ImVec2 &point)
 Snap a point for Sprites (16x16px)
 

Enumeration Type Documentation

◆ GridType

Snapping grids for different dungeon elements.

Enumerator
Object 
Sprite 
Item 
Door 

Definition at line 13 of file dungeon_snapping.h.

Function Documentation

◆ SnapToTile()

int yaze::editor::snapping::SnapToTile ( int pixel)
inline

Snap a pixel coordinate to the 8px tile grid.

Definition at line 23 of file dungeon_snapping.h.

Referenced by SnapToTileGrid().

◆ SnapToGrid()

int yaze::editor::snapping::SnapToGrid ( int pixel,
int grid_size )
inline

Snap a pixel coordinate to a specific grid size.

Definition at line 30 of file dungeon_snapping.h.

Referenced by SnapToItemGrid(), and SnapToSpriteGrid().

◆ SnapToTileGrid()

ImVec2 yaze::editor::snapping::SnapToTileGrid ( const ImVec2 & point)
inline

Snap a point to the 8px tile grid.

Definition at line 38 of file dungeon_snapping.h.

References SnapToTile().

Referenced by yaze::editor::TileObjectHandler::HandleDrag(), and yaze::editor::TileObjectHandler::InitDrag().

Here is the call graph for this function:

◆ SnapToItemGrid()

ImVec2 yaze::editor::snapping::SnapToItemGrid ( const ImVec2 & point)
inline

Snap a point for Pot Items (X: 4px, Y: 16px)

Definition at line 46 of file dungeon_snapping.h.

References SnapToGrid().

Here is the call graph for this function:

◆ SnapToSpriteGrid()

ImVec2 yaze::editor::snapping::SnapToSpriteGrid ( const ImVec2 & point)
inline

Snap a point for Sprites (16x16px)

Definition at line 54 of file dungeon_snapping.h.

References SnapToGrid().

Here is the call graph for this function: