SquareGrid

SquareGrid

Construct a square grid container

Constructor

new SquareGrid()

Source:

Methods

draw()

Source:

getCenter()

Source:

getGridPositionFromPixels()

Source:

getNeighbors()

Source:

getPixelsFromGridPosition()

Source:

getSnappedPosition()

Source:

getTopLeft()

Source:

highlightGridPosition()

Source:

measureDistances()

Source:

shiftPosition(x, y, dx, dy)

Source:

Shift a pixel position [x,y] by some number of grid units dx and dy

Parameters:
Name Type Description
x Number

The starting x-coordinate in pixels

y Number

The starting y-coordinate in pixels

dx Number

The number of grid positions to shift horizontally

dy Number

The number of grid positions to shift vertically