yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_snapping.h File Reference
#include <algorithm>
#include <cmath>
#include "imgui/imgui.h"
Include dependency graph for dungeon_snapping.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 
namespace  yaze::editor::snapping
 

Enumerations

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

Functions

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