-
-
Notifications
You must be signed in to change notification settings - Fork 18
place_snapped
drewmccluskey edited this page Feb 10, 2019
·
3 revisions
Returns whether an object is currently snapped within a specified grid
place_snapped(Vector2 cellSize)
Argument | Description |
---|---|
Vector2 hor |
Vector grid cell size |
Returns: bool
This function returns whether or not an object is currently in line with a grid based on the specified vector grid cell size.
if (place_snapped(new Vector2(16,16)) == 0)
{
move_snap(new Vector2(16,16));
}
The above code will check if the current object is in line with a 16x16 cell grid, and if not, it will snap it to the 16x16 cell grid.
Back to Movement