Skip to content

place_snapped

drewmccluskey edited this page Feb 10, 2019 · 3 revisions

place_snapped

Returns whether an object is currently snapped within a specified grid

Syntax:

place_snapped(Vector2 cellSize)
Argument Description
Vector2 hor Vector grid cell size

Returns: bool

Description:

This function returns whether or not an object is currently in line with a grid based on the specified vector grid cell size.

Example:

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

Clone this wiki locally