new gridersize(canvas)
Parameters:
Name | Type | Description |
---|---|---|
canvas |
jQuery | A jQuery element to use as canvas, preferably a div. |
- Source:
Returns:
Members
-
<static> version
-
- Source:
Methods
-
activateElementById(id)
-
Finds an element given its Id and activates it.
Parameters:
Name Type Description id
string Id to find. - Source:
Returns:
jQuery -
deactivateAll()
-
Deactivates all currently active elements.
- Source:
Returns:
ThisExpression -
draw()
-
Makes a simple draw. Updates only positions of divs.
- Source:
Returns:
ThisExpression -
findElementById(id)
-
Finds an element given its Id.
Parameters:
Name Type Description id
string Id to find. - Source:
Returns:
jQuery -
keys()
-
Adds keyboard shotcuts
- Source:
Returns:
ThisExpression -
mouse()
-
Enables mouse shortcuts (drag and drop)
- Source:
Returns:
ThisExpression -
render(elements, keep)
-
Adds elements to be rendered.
Parameters:
Name Type Description elements
array Elements to render. An element shoudl be of the form [x, y, x_size, y_size, id, properties] keep
boolean Should existing elements be kept on the canvas? - Source:
Returns:
ThisExpression -
setCenter(x, y, relative)
-
Description
Parameters:
Name Type Description x
number X-coordinate of the center. y
number Y-coordinate of the center. relative
boolean If set to true, set coordinates relatively. - Source:
Returns:
ThisExpression -
setZoom(level)
-
Sets the zoom level.
Parameters:
Name Type Description level
number Factor to set the zoom to. - Source:
Returns:
ThisExpression -
showAll(margin)
-
Shows everything that is currently on the screen. Changes zoom and center.
Parameters:
Name Type Argument Default Description margin
number <optional>
5 Margin to use. - Source:
Returns:
ThisExpression -
showRegion(minX, maxX, minY, maxY, margin)
-
Shows a specific Region.
Parameters:
Name Type Argument Default Description minX
number Minimal X Coordinate to show. maxX
number Maximal X Coordinate to show. minY
number Minimal Y Coordinate to show maxY
number Maximal Y Coordinate to show margin
number <optional>
5 Margin to use. Defaults to 5. - Source:
Returns:
ThisExpression