Skip to content

Rectangular 2D grid

Snap objects on a virtual grid.

Authors and contributors to this experimental extension: (not specified).


It allows to snap objects on a virtual 2D grid.

It's useful for:

  • level editors
  • building systems

A simple example shows how to snap objects that are dragged with the mouse.

Tip

Learn how to install new extensions by following a step-by-step guide.

Actions

Snap objects to a virtual grid
Snap object to a virtual grid (i.e: this is not the grid used in the editor).

See parameters
  • Parameter 1 (👾 Object): Objects to snap to the virtual grid
  • Parameter 2 (🔢 Number): Width of a cell of the virtual grid (in pixels)
  • Parameter 3 (🔢 Number): Height of a cell of the virtual grid (in pixels)
  • Parameter 4 (🔢 Number): Offset on the X axis of the virtual grid (in pixels)
  • Parameter 5 (🔢 Number): Offset on the Y axis of the virtual grid (in pixels)

Technical note: parameters 0, 6 are internal parameters handled by GDevelop.


This page is an auto-generated reference page about the Rectangular 2D grid extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.