Browse Source

Stencil objects

tentone 6 years ago
parent
commit
f0f7716170
58 changed files with 1005 additions and 346 deletions
  1. 54 36
      build/trenette.js
  2. 0 0
      build/trenette.min.js
  3. 54 36
      build/trenette.module.js
  4. 2 2
      docs/Box.html
  5. 2 2
      docs/Box2.html
  6. 2 2
      docs/Circle.html
  7. 2 2
      docs/DOM.html
  8. 2 2
      docs/EventManager.html
  9. 2 2
      docs/EventManager.js.html
  10. 350 0
      docs/Helpers.html
  11. 2 2
      docs/Image.html
  12. 2 2
      docs/Key.html
  13. 2 2
      docs/Line.html
  14. 2 2
      docs/Matrix.html
  15. 2 2
      docs/Object2D.html
  16. 2 2
      docs/Object2D.js.html
  17. 2 2
      docs/Pattern.html
  18. 2 2
      docs/Pointer.html
  19. 187 4
      docs/Renderer.html
  20. 17 3
      docs/Renderer.js.html
  21. 2 94
      docs/Stencil.html
  22. 2 2
      docs/Text.html
  23. 2 2
      docs/UUID.html
  24. 2 2
      docs/Vector2.html
  25. 2 2
      docs/Viewport.html
  26. 2 2
      docs/Viewport.js.html
  27. 2 2
      docs/index.html
  28. 2 2
      docs/input_Key.js.html
  29. 2 2
      docs/input_Pointer.js.html
  30. 2 2
      docs/math_Box2.js.html
  31. 2 2
      docs/math_Matrix.js.html
  32. 2 2
      docs/math_UUID.js.html
  33. 2 2
      docs/math_Vector2.js.html
  34. 2 2
      docs/objects_Box.js.html
  35. 2 2
      docs/objects_Circle.js.html
  36. 2 2
      docs/objects_DOM.js.html
  37. 2 2
      docs/objects_Image.js.html
  38. 2 2
      docs/objects_Line.js.html
  39. 2 2
      docs/objects_Pattern.js.html
  40. 2 2
      docs/objects_Text.js.html
  41. 6 6
      docs/stencil_Stencil.js.html
  42. 14 4
      docs/utils_Helpers.js.html
  43. 4 5
      examples/stencil.html
  44. 16 7
      source/Object2D.js
  45. 113 68
      source/Renderer.js
  46. 38 1
      source/math/Box2.js
  47. 3 1
      source/math/UUID.js
  48. 1 1
      source/objects/Box.js
  49. 1 1
      source/objects/Circle.js
  50. 1 1
      source/objects/DOM.js
  51. 1 1
      source/objects/Image.js
  52. 1 1
      source/objects/Line.js
  53. 1 1
      source/objects/Pattern.js
  54. 1 1
      source/objects/Text.js
  55. 34 0
      source/stencil/BoxStencil.js
  56. 13 0
      source/stencil/ResetStencil.js
  57. 15 6
      source/stencil/Stencil.js
  58. 12 2
      source/utils/Helpers.js

+ 54 - 36
build/trenette.js

@@ -799,7 +799,7 @@
 	};
 	};
 
 
 	/**
 	/**
-	 * Apply the transform to the rendering context.
+	 * Apply the transform to the rendering context, it is assumed that the viewport transform is pre-applied to the context.
 	 *
 	 *
 	 * Can also be used for pre rendering logic.
 	 * Can also be used for pre rendering logic.
 	 */
 	 */
@@ -815,7 +815,7 @@
 	 *
 	 *
 	 * @param context Canvas 2d drawing context.
 	 * @param context Canvas 2d drawing context.
 	 */
 	 */
-	Object2D.prototype.draw = function(context, viewport){};
+	Object2D.prototype.draw = function(context, viewport, canvas){};
 
 
 	/**
 	/**
 	 * Callback method called every time before the object is draw into the canvas.
 	 * Callback method called every time before the object is draw into the canvas.
@@ -1380,6 +1380,20 @@
 		this.autoClear = true;
 		this.autoClear = true;
 	}
 	}
 
 
+	/**
+	 * Creates a infinite render loop to render the group into a viewport each frame.
+	 *
+	 * The render loop cannot be destroyed.
+	 *
+	 * @param {Object2D} group Group to be rendererd.
+	 * @param {Viewport} viewport Viewport into the objects.
+	 * @param {Function} onUpdate Function called before rendering the frame.
+	 */
+	Renderer.prototype.createRenderLoop = function(group, viewport, onUpdate)
+	{
+
+	};
+
 	/**
 	/**
 	 * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
 	 * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
 	 *
 	 *
@@ -1387,7 +1401,7 @@
 	 *
 	 *
 	 * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
 	 * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
 	 *
 	 *
-	 * Should be called at a fixed rate preferably using the requestAnimationFrame() method.
+	 * Should be called at a fixed rate preferably using the requestAnimationFrame() method, its also possible to use the createRenderLoop() method, that automatically creates a infinite render loop.
 	 *
 	 *
 	 * @param object Object to be updated.
 	 * @param object Object to be updated.
 	 * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
 	 * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
@@ -1555,8 +1569,8 @@
 				this.context.setTransform(1, 0, 0, 1, 0, 0);
 				this.context.setTransform(1, 0, 0, 1, 0, 0);
 			}
 			}
 
 
-			objects[i].transform(this.context, viewport);
-			objects[i].draw(this.context, viewport);
+			objects[i].transform(this.context, viewport, this.canvas);
+			objects[i].draw(this.context, viewport, this.canvas);
 
 
 			if(objects[i].restoreContextState)
 			if(objects[i].restoreContextState)
 			{
 			{
@@ -1655,28 +1669,6 @@
 		}
 		}
 	};
 	};
 
 
-	/**
-	 * A stencil can be used to set the drawing region.
-	 *
-	 * Stencils are treated as objects their shaphe is used to filter other objects shape.
-	 *
-	 * Multiple stencil objects can be active simulatenously.
-	 *
-	 * @class
-	 */
-	function Stencil()
-	{
-		//TODO <ADD CODE HERE>
-	}
-
-	/**
-	 * Activate the stencil.
-	 */
-	Stencil.prototype.draw = function()
-	{
-		// body...
-	};
-
 	/**
 	/**
 	 * Box is described by a minimum and maximum points.
 	 * Box is described by a minimum and maximum points.
 	 *
 	 *
@@ -1870,6 +1862,22 @@
 		return box.min.equals(this.min) && box.max.equals(this.max);
 		return box.min.equals(this.min) && box.max.equals(this.max);
 	};
 	};
 
 
+	/**
+	 * A stencil can be used to set the drawing region.
+	 *
+	 * Stencils are treated as objects their shaphe is used to filter other objects shape.
+	 *
+	 * Multiple stencil objects can be active simulatenously.
+	 *
+	 * @class
+	 */
+	function Stencil()
+	{
+		Object2D.call(this);
+	}
+
+	Stencil.prototype = Object.create(Object2D.prototype);
+
 	/**
 	/**
 	 * Circle object draw a circular object, into the canvas.
 	 * Circle object draw a circular object, into the canvas.
 	 *
 	 *
@@ -1912,7 +1920,7 @@
 		this.fillStyle = "#FFFFFF";
 		this.fillStyle = "#FFFFFF";
 	};
 	};
 
 
-	Circle.prototype.draw = function(context)
+	Circle.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		context.fillStyle = this.fillStyle;
 		context.fillStyle = this.fillStyle;
 
 
@@ -1928,11 +1936,19 @@
 		context.stroke();
 		context.stroke();
 	};
 	};
 
 
+	/**
+	 * Class contains helper functions to create editing object tools.
+	 *
+	 * @class
+	 */
 	function Helpers(){}
 	function Helpers(){}
 
 
-
 	/**
 	/**
-	 * Create a rotation tool
+	 * Create a rotation tool helper.
+	 *
+	 * When the object is dragged is changes the parent object rotation.
+	 *
+	 * @static
 	 */
 	 */
 	Helpers.rotateTool = function(object)
 	Helpers.rotateTool = function(object)
 	{
 	{
@@ -1952,6 +1968,8 @@
 	 * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
 	 * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
 	 *
 	 *
 	 * This method required to object to have a box property.
 	 * This method required to object to have a box property.
+	 *
+	 * @static
 	 */
 	 */
 	Helpers.boxResizeTool = function(object)
 	Helpers.boxResizeTool = function(object)
 	{
 	{
@@ -2068,7 +2086,7 @@
 		return this.box.containsPoint(point);
 		return this.box.containsPoint(point);
 	};
 	};
 
 
-	Box.prototype.draw = function(context)
+	Box.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		var width = this.box.max.x - this.box.min.x;
 		var width = this.box.max.x - this.box.min.x;
 		var height = this.box.max.y - this.box.min.y;
 		var height = this.box.max.y - this.box.min.y;
@@ -2122,7 +2140,7 @@
 
 
 	Line.prototype = Object.create(Object2D.prototype);
 	Line.prototype = Object.create(Object2D.prototype);
 
 
-	Line.prototype.draw = function(context)
+	Line.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		context.lineWidth = this.lineWidth;
 		context.lineWidth = this.lineWidth;
 		context.strokeStyle = this.strokeStyle;
 		context.strokeStyle = this.strokeStyle;
@@ -2166,7 +2184,7 @@
 
 
 	Text.prototype = Object.create(Object2D.prototype);
 	Text.prototype = Object.create(Object2D.prototype);
 
 
-	Text.prototype.draw = function(context)
+	Text.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		context.font = this.font;
 		context.font = this.font;
 		context.textAlign = this.textAlign;
 		context.textAlign = this.textAlign;
@@ -2227,7 +2245,7 @@
 		return this.box.containsPoint(point);
 		return this.box.containsPoint(point);
 	};
 	};
 
 
-	Image.prototype.draw = function(context)
+	Image.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 		context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 	};
 	};
@@ -2267,7 +2285,7 @@
 
 
 	DOM.prototype = Object.create(Object2D.prototype);
 	DOM.prototype = Object.create(Object2D.prototype);
 
 
-	DOM.prototype.draw = function(context, viewport)
+	DOM.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		// CSS trasnformation matrix
 		// CSS trasnformation matrix
 		var projection = viewport.matrix.clone();
 		var projection = viewport.matrix.clone();
@@ -2335,7 +2353,7 @@
 		return this.box.containsPoint(point);
 		return this.box.containsPoint(point);
 	};
 	};
 
 
-	Pattern.prototype.draw = function(context, viewport)
+	Pattern.prototype.draw = function(context, viewport, canvas)
 	{
 	{
 		var width = this.box.max.x - this.box.min.x;
 		var width = this.box.max.x - this.box.min.x;
 		var height = this.box.max.y - this.box.min.y;
 		var height = this.box.max.y - this.box.min.y;

File diff suppressed because it is too large
+ 0 - 0
build/trenette.min.js


+ 54 - 36
build/trenette.module.js

@@ -793,7 +793,7 @@ Object2D.prototype.updateMatrix = function(context)
 };
 };
 
 
 /**
 /**
- * Apply the transform to the rendering context.
+ * Apply the transform to the rendering context, it is assumed that the viewport transform is pre-applied to the context.
  *
  *
  * Can also be used for pre rendering logic.
  * Can also be used for pre rendering logic.
  */
  */
@@ -809,7 +809,7 @@ Object2D.prototype.transform = function(context, viewport)
  *
  *
  * @param context Canvas 2d drawing context.
  * @param context Canvas 2d drawing context.
  */
  */
-Object2D.prototype.draw = function(context, viewport){};
+Object2D.prototype.draw = function(context, viewport, canvas){};
 
 
 /**
 /**
  * Callback method called every time before the object is draw into the canvas.
  * Callback method called every time before the object is draw into the canvas.
@@ -1374,6 +1374,20 @@ function Renderer(canvas)
 	this.autoClear = true;
 	this.autoClear = true;
 }
 }
 
 
+/**
+ * Creates a infinite render loop to render the group into a viewport each frame.
+ *
+ * The render loop cannot be destroyed.
+ *
+ * @param {Object2D} group Group to be rendererd.
+ * @param {Viewport} viewport Viewport into the objects.
+ * @param {Function} onUpdate Function called before rendering the frame.
+ */
+Renderer.prototype.createRenderLoop = function(group, viewport, onUpdate)
+{
+
+};
+
 /**
 /**
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  *
  *
@@ -1381,7 +1395,7 @@ function Renderer(canvas)
  *
  *
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  *
  *
- * Should be called at a fixed rate preferably using the requestAnimationFrame() method.
+ * Should be called at a fixed rate preferably using the requestAnimationFrame() method, its also possible to use the createRenderLoop() method, that automatically creates a infinite render loop.
  *
  *
  * @param object Object to be updated.
  * @param object Object to be updated.
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
@@ -1549,8 +1563,8 @@ Renderer.prototype.update = function(object, viewport)
 			this.context.setTransform(1, 0, 0, 1, 0, 0);
 			this.context.setTransform(1, 0, 0, 1, 0, 0);
 		}
 		}
 
 
-		objects[i].transform(this.context, viewport);
-		objects[i].draw(this.context, viewport);
+		objects[i].transform(this.context, viewport, this.canvas);
+		objects[i].draw(this.context, viewport, this.canvas);
 
 
 		if(objects[i].restoreContextState)
 		if(objects[i].restoreContextState)
 		{
 		{
@@ -1649,28 +1663,6 @@ Viewport.prototype.updateMatrix = function()
 	}
 	}
 };
 };
 
 
-/**
- * A stencil can be used to set the drawing region.
- *
- * Stencils are treated as objects their shaphe is used to filter other objects shape.
- *
- * Multiple stencil objects can be active simulatenously.
- *
- * @class
- */
-function Stencil()
-{
-	//TODO <ADD CODE HERE>
-}
-
-/**
- * Activate the stencil.
- */
-Stencil.prototype.draw = function()
-{
-	// body...
-};
-
 /**
 /**
  * Box is described by a minimum and maximum points.
  * Box is described by a minimum and maximum points.
  *
  *
@@ -1864,6 +1856,22 @@ Box2.prototype.equals = function(box)
 	return box.min.equals(this.min) && box.max.equals(this.max);
 	return box.min.equals(this.min) && box.max.equals(this.max);
 };
 };
 
 
+/**
+ * A stencil can be used to set the drawing region.
+ *
+ * Stencils are treated as objects their shaphe is used to filter other objects shape.
+ *
+ * Multiple stencil objects can be active simulatenously.
+ *
+ * @class
+ */
+function Stencil()
+{
+	Object2D.call(this);
+}
+
+Stencil.prototype = Object.create(Object2D.prototype);
+
 /**
 /**
  * Circle object draw a circular object, into the canvas.
  * Circle object draw a circular object, into the canvas.
  *
  *
@@ -1906,7 +1914,7 @@ Circle.prototype.onPointerLeave = function(pointer, viewport)
 	this.fillStyle = "#FFFFFF";
 	this.fillStyle = "#FFFFFF";
 };
 };
 
 
-Circle.prototype.draw = function(context)
+Circle.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.fillStyle = this.fillStyle;
 	context.fillStyle = this.fillStyle;
 
 
@@ -1922,11 +1930,19 @@ Circle.prototype.draw = function(context)
 	context.stroke();
 	context.stroke();
 };
 };
 
 
+/**
+ * Class contains helper functions to create editing object tools.
+ *
+ * @class
+ */
 function Helpers(){}
 function Helpers(){}
 
 
-
 /**
 /**
- * Create a rotation tool
+ * Create a rotation tool helper.
+ *
+ * When the object is dragged is changes the parent object rotation.
+ *
+ * @static
  */
  */
 Helpers.rotateTool = function(object)
 Helpers.rotateTool = function(object)
 {
 {
@@ -1946,6 +1962,8 @@ Helpers.rotateTool = function(object)
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  *
  *
  * This method required to object to have a box property.
  * This method required to object to have a box property.
+ *
+ * @static
  */
  */
 Helpers.boxResizeTool = function(object)
 Helpers.boxResizeTool = function(object)
 {
 {
@@ -2062,7 +2080,7 @@ Box.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Box.prototype.draw = function(context)
+Box.prototype.draw = function(context, viewport, canvas)
 {
 {
 	var width = this.box.max.x - this.box.min.x;
 	var width = this.box.max.x - this.box.min.x;
 	var height = this.box.max.y - this.box.min.y;
 	var height = this.box.max.y - this.box.min.y;
@@ -2116,7 +2134,7 @@ function Line()
 
 
 Line.prototype = Object.create(Object2D.prototype);
 Line.prototype = Object.create(Object2D.prototype);
 
 
-Line.prototype.draw = function(context)
+Line.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.lineWidth = this.lineWidth;
 	context.lineWidth = this.lineWidth;
 	context.strokeStyle = this.strokeStyle;
 	context.strokeStyle = this.strokeStyle;
@@ -2160,7 +2178,7 @@ function Text()
 
 
 Text.prototype = Object.create(Object2D.prototype);
 Text.prototype = Object.create(Object2D.prototype);
 
 
-Text.prototype.draw = function(context)
+Text.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.font = this.font;
 	context.font = this.font;
 	context.textAlign = this.textAlign;
 	context.textAlign = this.textAlign;
@@ -2221,7 +2239,7 @@ Image.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Image.prototype.draw = function(context)
+Image.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 	context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 };
 };
@@ -2261,7 +2279,7 @@ function DOM(parent, type)
 
 
 DOM.prototype = Object.create(Object2D.prototype);
 DOM.prototype = Object.create(Object2D.prototype);
 
 
-DOM.prototype.draw = function(context, viewport)
+DOM.prototype.draw = function(context, viewport, canvas)
 {
 {
 	// CSS trasnformation matrix
 	// CSS trasnformation matrix
 	var projection = viewport.matrix.clone();
 	var projection = viewport.matrix.clone();
@@ -2329,7 +2347,7 @@ Pattern.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Pattern.prototype.draw = function(context, viewport)
+Pattern.prototype.draw = function(context, viewport, canvas)
 {
 {
 	var width = this.box.max.x - this.box.min.x;
 	var width = this.box.max.x - this.box.min.x;
 	var height = this.box.max.y - this.box.min.y;
 	var height = this.box.max.y - this.box.min.y;

+ 2 - 2
docs/Box.html

@@ -345,13 +345,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Box2.html

@@ -1443,13 +1443,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Circle.html

@@ -345,13 +345,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/DOM.html

@@ -345,13 +345,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/EventManager.html

@@ -682,13 +682,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/EventManager.js.html

@@ -105,13 +105,13 @@ export {EventManager};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 350 - 0
docs/Helpers.html

@@ -0,0 +1,350 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Helpers</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Helpers</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2><span class="attribs"><span class="type-signature"></span></span>Helpers<span class="signature">()</span><span class="type-signature"></span></h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    
+    <h4 class="name" id="Helpers"><span class="type-signature"></span>new Helpers<span class="signature">()</span><span class="type-signature"></span></h4>
+    
+
+    
+
+
+
+<div class="description">
+    Class contains helper functions to create editing object tools.
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="utils_Helpers.js.html">utils/Helpers.js</a>, <a href="utils_Helpers.js.html#line11">line 11</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    
+    <h4 class="name" id=".boxResizeTool"><span class="type-signature">(static) </span>boxResizeTool<span class="signature">()</span><span class="type-signature"></span></h4>
+    
+
+    
+
+
+
+<div class="description">
+    Create a box resize helper and attach it to an object to change the size of the object box.

Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.

This method required to object to have a box property.
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="utils_Helpers.js.html">utils/Helpers.js</a>, <a href="utils_Helpers.js.html#line41">line 41</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+            
+
+    
+
+    
+    <h4 class="name" id=".rotateTool"><span class="type-signature">(static) </span>rotateTool<span class="signature">()</span><span class="type-signature"></span></h4>
+    
+
+    
+
+
+
+<div class="description">
+    Create a rotation tool helper.

When the object is dragged is changes the parent object rotation.
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="utils_Helpers.js.html">utils/Helpers.js</a>, <a href="utils_Helpers.js.html#line20">line 20</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>

+ 2 - 2
docs/Image.html

@@ -485,13 +485,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Key.html

@@ -613,13 +613,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Line.html

@@ -469,13 +469,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Matrix.html

@@ -1875,13 +1875,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Object2D.html

@@ -2717,13 +2717,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Object2D.js.html

@@ -306,13 +306,13 @@ export {Object2D};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Pattern.html

@@ -437,13 +437,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Pointer.html

@@ -2554,13 +2554,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 187 - 4
docs/Renderer.html

@@ -395,6 +395,189 @@
     
     
         <h3 class="subsection-title">Methods</h3>
         <h3 class="subsection-title">Methods</h3>
 
 
+        
+            
+
+    
+
+    
+    <h4 class="name" id="createRenderLoop"><span class="type-signature"></span>createRenderLoop<span class="signature">(group, viewport, onUpdate)</span><span class="type-signature"></span></h4>
+    
+
+    
+
+
+
+<div class="description">
+    Creates a infinite render loop to render the group into a viewport each frame.

The render loop cannot be destroyed.
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>group</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="Object2D.html">Object2D</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Group to be rendererd.</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>viewport</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="Viewport.html">Viewport</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Viewport into the objects.</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>onUpdate</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Function called before rendering the frame.</td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="Renderer.js.html">Renderer.js</a>, <a href="Renderer.js.html#line47">line 47</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
         
         
             
             
 
 
@@ -409,7 +592,7 @@
 
 
 
 
 <div class="description">
 <div class="description">
-    Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.

Render the object using the viewport into a canvas element.

The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.

Should be called at a fixed rate preferably using the requestAnimationFrame() method.
+    Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.

Render the object using the viewport into a canvas element.

The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.

Should be called at a fixed rate preferably using the requestAnimationFrame() method, its also possible to use the createRenderLoop() method, that automatically creates a infinite render loop.
 </div>
 </div>
 
 
 
 
@@ -515,7 +698,7 @@
     
     
     <dt class="tag-source">Source:</dt>
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="Renderer.js.html">Renderer.js</a>, <a href="Renderer.js.html#line50">line 50</a>
+        <a href="Renderer.js.html">Renderer.js</a>, <a href="Renderer.js.html#line64">line 64</a>
     </li></ul></dd>
     </li></ul></dd>
     
     
 
 
@@ -561,13 +744,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 17 - 3
docs/Renderer.js.html

@@ -63,6 +63,20 @@ function Renderer(canvas)
 	this.autoClear = true;
 	this.autoClear = true;
 }
 }
 
 
+/**
+ * Creates a infinite render loop to render the group into a viewport each frame.
+ *
+ * The render loop cannot be destroyed.
+ *
+ * @param {Object2D} group Group to be rendererd.
+ * @param {Viewport} viewport Viewport into the objects.
+ * @param {Function} onUpdate Function called before rendering the frame.
+ */
+Renderer.prototype.createRenderLoop = function(group, viewport, onUpdate)
+{
+
+};
+
 /**
 /**
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  *
  *
@@ -70,7 +84,7 @@ function Renderer(canvas)
  *
  *
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  *
  *
- * Should be called at a fixed rate preferably using the requestAnimationFrame() method.
+ * Should be called at a fixed rate preferably using the requestAnimationFrame() method, its also possible to use the createRenderLoop() method, that automatically creates a infinite render loop.
  *
  *
  * @param object Object to be updated.
  * @param object Object to be updated.
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
@@ -259,13 +273,13 @@ export {Renderer};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 94
docs/Stencil.html

@@ -140,98 +140,6 @@
 
 
     
     
 
 
-    
-        <h3 class="subsection-title">Methods</h3>
-
-        
-            
-
-    
-
-    
-    <h4 class="name" id="draw"><span class="type-signature"></span>draw<span class="signature">()</span><span class="type-signature"></span></h4>
-    
-
-    
-
-
-
-<div class="description">
-    Activate the stencil.
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
-
-<dl class="details">
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-
-    
-    <dt class="tag-source">Source:</dt>
-    <dd class="tag-source"><ul class="dummy"><li>
-        <a href="stencil_Stencil.js.html">stencil/Stencil.js</a>, <a href="stencil_Stencil.js.html#line20">line 20</a>
-    </li></ul></dd>
-    
-
-    
-
-    
-
-    
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-        
     
     
 
 
     
     
@@ -247,13 +155,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Text.html

@@ -407,13 +407,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/UUID.html

@@ -221,13 +221,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Vector2.html

@@ -247,13 +247,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Viewport.html

@@ -835,13 +835,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/Viewport.js.html

@@ -134,13 +134,13 @@ export {Viewport};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/index.html

@@ -50,13 +50,13 @@
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/input_Key.js.html

@@ -120,13 +120,13 @@ export {Key};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/input_Pointer.js.html

@@ -437,13 +437,13 @@ export {Pointer};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/math_Box2.js.html

@@ -234,13 +234,13 @@ export {Box2};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/math_Matrix.js.html

@@ -265,13 +265,13 @@ export {Matrix};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/math_UUID.js.html

@@ -75,13 +75,13 @@ export {UUID};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/math_Vector2.js.html

@@ -318,13 +318,13 @@ export {Vector2};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Box.js.html

@@ -102,13 +102,13 @@ export {Box};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Circle.js.html

@@ -99,13 +99,13 @@ export {Circle};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_DOM.js.html

@@ -88,13 +88,13 @@ export {DOM};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Image.js.html

@@ -100,13 +100,13 @@ export {Image};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Line.js.html

@@ -95,13 +95,13 @@ export {Line};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Pattern.js.html

@@ -113,13 +113,13 @@ export {Pattern};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 2 - 2
docs/objects_Text.js.html

@@ -82,13 +82,13 @@ export {Text};
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 6 - 6
docs/stencil_Stencil.js.html

@@ -39,13 +39,13 @@
  */
  */
 function Stencil()
 function Stencil()
 {
 {
+	Object2D.call(this);
 	//TODO &lt;ADD CODE HERE>
 	//TODO &lt;ADD CODE HERE>
 }
 }
 
 
-/**
- * Activate the stencil.
- */
-Stencil.prototype.draw = function()
+Stencil.prototype = Object.create(Object2D.prototype);
+
+Stencil.prototype.draw = function(context, viewport)
 {
 {
 	// body...
 	// body...
 };
 };
@@ -60,13 +60,13 @@ export {Stencil};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 14 - 4
docs/utils_Helpers.js.html

@@ -31,11 +31,19 @@
 import {Circle} from "../objects/Circle.js";
 import {Circle} from "../objects/Circle.js";
 import {Object2D} from "../Object2D.js";
 import {Object2D} from "../Object2D.js";
 
 
+/**
+ * Class contains helper functions to create editing object tools.
+ *
+ * @class
+ */
 function Helpers(){}
 function Helpers(){}
 
 
-
 /**
 /**
- * Create a rotation tool
+ * Create a rotation tool helper.
+ *
+ * When the object is dragged is changes the parent object rotation.
+ *
+ * @static
  */
  */
 Helpers.rotateTool = function(object)
 Helpers.rotateTool = function(object)
 {
 {
@@ -55,6 +63,8 @@ Helpers.rotateTool = function(object)
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  *
  *
  * This method required to object to have a box property.
  * This method required to object to have a box property.
+ *
+ * @static
  */
  */
 Helpers.boxResizeTool = function(object)
 Helpers.boxResizeTool = function(object)
 {
 {
@@ -139,13 +149,13 @@ export {Helpers};</code></pre>
 </div>
 </div>
 
 
 <nav>
 <nav>
-    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Box.html">Box</a></li><li><a href="Box2.html">Box2</a></li><li><a href="Circle.html">Circle</a></li><li><a href="DOM.html">DOM</a></li><li><a href="EventManager.html">EventManager</a></li><li><a href="Helpers.html">Helpers</a></li><li><a href="Image.html">Image</a></li><li><a href="Key.html">Key</a></li><li><a href="Line.html">Line</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="Object2D.html">Object2D</a></li><li><a href="Pattern.html">Pattern</a></li><li><a href="Pointer.html">Pointer</a></li><li><a href="Renderer.html">Renderer</a></li><li><a href="Stencil.html">Stencil</a></li><li><a href="Text.html">Text</a></li><li><a href="UUID.html">UUID</a></li><li><a href="Vector2.html">Vector2</a></li><li><a href="Viewport.html">Viewport</a></li></ul>
 </nav>
 </nav>
 
 
 <br class="clear">
 <br class="clear">
 
 
 <footer>
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 12:11:39 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 06 2019 13:51:53 GMT+0100 (Western European Summer Time)
 </footer>
 </footer>
 
 
 <script> prettyPrint(); </script>
 <script> prettyPrint(); </script>

+ 4 - 5
examples/stencil.html

@@ -49,10 +49,10 @@
 			var box = new Trenette.Box();
 			var box = new Trenette.Box();
 			box.draggable = true;
 			box.draggable = true;
 			box.layer = 9;
 			box.layer = 9;
-			box.draw = function(context)
+			box.draw = function(context, viewport, canvas)
 			{
 			{
 				var width = this.box.max.x - this.box.min.x;
 				var width = this.box.max.x - this.box.min.x;
-
+				
 				context.beginPath();
 				context.beginPath();
 				context.rect(this.box.min.x - 1e4, -5e3, 1e4, 1e4);
 				context.rect(this.box.min.x - 1e4, -5e3, 1e4, 1e4);
 				context.rect(this.box.max.x, -5e3, 1e4, 1e4);
 				context.rect(this.box.max.x, -5e3, 1e4, 1e4);
@@ -99,10 +99,10 @@
 		var blackLayer = new Trenette.Object2D();
 		var blackLayer = new Trenette.Object2D();
 		blackLayer.ignoreViewport = true;
 		blackLayer.ignoreViewport = true;
 		blackLayer.layer = 10;
 		blackLayer.layer = 10;
-		blackLayer.draw = function(context)
+		blackLayer.draw = function(context, viewport, canvas)
 		{
 		{
 			context.fillStyle = "rgba(0.0, 0.0, 0.0, 0.3)";
 			context.fillStyle = "rgba(0.0, 0.0, 0.0, 0.3)";
-			context.fillRect(0, 0, 1e5, 1e5);
+			context.fillRect(0, 0, canvas.width, canvas.height);
 		};
 		};
 		blackLayer.isInside = function(point)
 		blackLayer.isInside = function(point)
 		{
 		{
@@ -118,7 +118,6 @@
 
 
 		var renderer = new Trenette.Renderer(canvas);
 		var renderer = new Trenette.Renderer(canvas);
 
 
-
 		// Update and render the diagram
 		// Update and render the diagram
 		function loop()
 		function loop()
 		{			
 		{			

+ 16 - 7
source/Object2D.js

@@ -89,6 +89,13 @@ function Object2D()
 	 */
 	 */
 	this.draggable = false;
 	this.draggable = false;
 
 
+	/**
+	 * Indicates if this object uses pointer events.
+	 *
+	 * Can be set false to skip the pointer interaction events.
+	 */
+	this.pointerEvents = true;
+
 	/**
 	/**
 	 * Flag to indicate wheter this objet ignores the viewport transformation.
 	 * Flag to indicate wheter this objet ignores the viewport transformation.
 	 */
 	 */
@@ -104,11 +111,6 @@ function Object2D()
 	 */
 	 */
 	this.restoreContextState = true;
 	this.restoreContextState = true;
 
 
-	/**
-	 * Flag to indicate if the context of canvas should be restored after render.
-	 */
-	this.restoreContextState = true;
-
 	/**
 	/**
 	 * Flag indicating if the pointer is inside of the element.
 	 * Flag indicating if the pointer is inside of the element.
 	 *
 	 *
@@ -196,7 +198,12 @@ Object2D.prototype.updateMatrix = function(context)
 /**
 /**
  * Apply the transform to the rendering context.
  * Apply the transform to the rendering context.
  *
  *
+ * It is assumed that the viewport transform is pre-applied to the context.
+ *
  * Can also be used for pre rendering logic.
  * Can also be used for pre rendering logic.
+ *
+ * @param {CanvasContext} context Canvas 2d drawing context.
+ * @param {Viewport} viewport Viewport applied to the canvas.
  */
  */
 Object2D.prototype.transform = function(context, viewport)
 Object2D.prototype.transform = function(context, viewport)
 {
 {
@@ -208,9 +215,11 @@ Object2D.prototype.transform = function(context, viewport)
  *
  *
  * Has to be implemented by underlying classes.
  * Has to be implemented by underlying classes.
  *
  *
- * @param context Canvas 2d drawing context.
+ * @param {CanvasContext} context Canvas 2d drawing context.
+ * @param {Viewport} viewport Viewport applied to the canvas.
+ * @param {DOM} canvas DOM canvas element where the content is being drawn.
  */
  */
-Object2D.prototype.draw = function(context, viewport){};
+Object2D.prototype.draw = function(context, viewport, canvas){};
 
 
 /**
 /**
  * Callback method called every time before the object is draw into the canvas.
  * Callback method called every time before the object is draw into the canvas.

+ 113 - 68
source/Renderer.js

@@ -35,6 +35,31 @@ function Renderer(canvas)
 	this.autoClear = true;
 	this.autoClear = true;
 }
 }
 
 
+/**
+ * Creates a infinite render loop to render the group into a viewport each frame.
+ *
+ * The render loop cannot be destroyed.
+ *
+ * @param {Object2D} group Group to be rendererd.
+ * @param {Viewport} viewport Viewport into the objects.
+ * @param {Function} onUpdate Function called before rendering the frame.
+ */
+Renderer.prototype.createRenderLoop = function(group, viewport, onUpdate)
+{
+	function loop()
+	{
+		if(onUpdate !== undefined)
+		{
+			onUpdate();
+		}
+
+		this.update(group, viewport);
+		requestAnimationFrame(loop);
+	}
+
+	loop();
+};
+
 /**
 /**
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  * Update the renderer state, update the input handlers, calculate the object and viewport transformation matrices.
  *
  *
@@ -42,7 +67,7 @@ function Renderer(canvas)
  *
  *
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  * The canvas state is saved and restored for each individual object, ensuring that the code of one object does not affect another one.
  *
  *
- * Should be called at a fixed rate preferably using the requestAnimationFrame() method.
+ * Should be called at a fixed rate preferably using the requestAnimationFrame() method, its also possible to use the createRenderLoop() method, that automatically creates a infinite render loop.
  *
  *
  * @param object Object to be updated.
  * @param object Object to be updated.
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
  * @param viewport Viewport to be updated (should be the one where the objects will be rendered after).
@@ -77,84 +102,89 @@ Renderer.prototype.update = function(object, viewport)
 	var point = pointer.position.clone();
 	var point = pointer.position.clone();
 	var viewportPoint = viewport.inverseMatrix.transformPoint(point);
 	var viewportPoint = viewport.inverseMatrix.transformPoint(point);
 
 
-	// Object transformation matrices
+	// Object pointer events
 	for(var i = 0; i < objects.length; i++)
 	for(var i = 0; i < objects.length; i++)
 	{
 	{
 		var child = objects[i];
 		var child = objects[i];
-		var childPoint = child.inverseGlobalMatrix.transformPoint(child.ignoreViewport ? point : viewportPoint);
-
-		// Check if the pointer pointer is inside
-		if(child.isInside(childPoint))
+		
+		//Process the
+		if(child.pointerEvents)
 		{
 		{
-			// Pointer enter
-			if(!child.pointerInside && child.onPointerEnter !== null)
-			{			
-				child.onPointerEnter(pointer, viewport);
-			}
+			var childPoint = child.inverseGlobalMatrix.transformPoint(child.ignoreViewport ? point : viewportPoint);
 
 
-			// Pointer over
-			if(child.onPointerOver !== null)
+			// Check if the pointer pointer is inside
+			if(child.isInside(childPoint))
 			{
 			{
-				child.onPointerOver(pointer, viewport);
-			}
+				// Pointer enter
+				if(!child.pointerInside && child.onPointerEnter !== null)
+				{			
+					child.onPointerEnter(pointer, viewport);
+				}
 
 
-			// Pointer pressed
-			if(pointer.buttonPressed(Pointer.LEFT) && child.onButtonPressed !== null)
-			{	
-				child.onButtonPressed(pointer, viewport);
-			}
+				// Pointer over
+				if(child.onPointerOver !== null)
+				{
+					child.onPointerOver(pointer, viewport);
+				}
 
 
-			// Just released
-			if(pointer.buttonJustReleased(Pointer.LEFT) && child.onButtonUp !== null)
-			{	
-				child.onButtonUp(pointer, viewport);
-			}
+				// Pointer pressed
+				if(pointer.buttonPressed(Pointer.LEFT) && child.onButtonPressed !== null)
+				{	
+					child.onButtonPressed(pointer, viewport);
+				}
 
 
-			// Pointer just pressed
-			if(pointer.buttonJustPressed(Pointer.LEFT))
-			{
-				if(child.onButtonDown !== null)
-				{
-					child.onButtonDown(pointer, viewport);
+				// Just released
+				if(pointer.buttonJustReleased(Pointer.LEFT) && child.onButtonUp !== null)
+				{	
+					child.onButtonUp(pointer, viewport);
 				}
 				}
 
 
-				if(child.draggable)
+				// Pointer just pressed
+				if(pointer.buttonJustPressed(Pointer.LEFT))
 				{
 				{
-					child.beingDragged = true;
-
-					// Only start a drag operation on the top element.
-					break;
+					if(child.onButtonDown !== null)
+					{
+						child.onButtonDown(pointer, viewport);
+					}
+
+					// Drag object and break to only start a drag operation on the top element.
+					if(child.draggable)
+					{
+						child.beingDragged = true;
+						break;
+					}
 				}
 				}
-			}
 
 
-			child.pointerInside = true;
-		}
-		else if(child.pointerInside)
-		{
-			// Pointer leave
-			if(child.onPointerLeave !== null)
-			{
-				child.onPointerLeave(pointer, viewport);
+				child.pointerInside = true;
 			}
 			}
+			else if(child.pointerInside)
+			{
+				// Pointer leave
+				if(child.onPointerLeave !== null)
+				{
+					child.onPointerLeave(pointer, viewport);
+				}
 
 
-			child.pointerInside = false;
-		}
+				child.pointerInside = false;
+			}
 
 
-		// Stop object drag
-		if(pointer.buttonJustReleased(Pointer.LEFT))
-		{	
-			if(child.draggable)
-			{
-				child.beingDragged = false;
+			// Stop object drag
+			if(pointer.buttonJustReleased(Pointer.LEFT))
+			{	
+				if(child.draggable)
+				{
+					child.beingDragged = false;
+				}
 			}
 			}
 		}
 		}
 	}
 	}
 
 
-	// Pointer drag event
+	// Object drag events and update logic
 	for(var i = 0; i < objects.length; i++)
 	for(var i = 0; i < objects.length; i++)
 	{
 	{
 		var child = objects[i];
 		var child = objects[i];
 
 
+		// Pointer drag event
 		if(child.beingDragged)
 		if(child.beingDragged)
 		{	
 		{	
 			var lastPosition = pointer.position.clone();
 			var lastPosition = pointer.position.clone();
@@ -177,17 +207,21 @@ Renderer.prototype.update = function(object, viewport)
 		{
 		{
 			child.onUpdate();
 			child.onUpdate();
 		}
 		}
-
-		child.updateMatrix();
 	}
 	}
 
 
+	// Update transformation matrices
+	object.traverse(function(child)
+	{
+		child.updateMatrix();
+	});
+	
 	// Sort objects by layer
 	// Sort objects by layer
 	objects.sort(function(a, b)
 	objects.sort(function(a, b)
 	{
 	{
 		return a.layer - b.layer;
 		return a.layer - b.layer;
 	});
 	});
 
 
-	// Clear canvas
+	// Clear canvas content
 	if(this.autoClear)
 	if(this.autoClear)
 	{
 	{
 		this.context.setTransform(1, 0, 0, 1, 0, 0);
 		this.context.setTransform(1, 0, 0, 1, 0, 0);
@@ -200,22 +234,33 @@ Renderer.prototype.update = function(object, viewport)
 	// Render into the canvas
 	// Render into the canvas
 	for(var i = 0; i < objects.length; i++)
 	for(var i = 0; i < objects.length; i++)
 	{	
 	{	
-		if(objects[i].saveContextState)
-		{
-			this.context.save();
-		}
 
 
-		if(objects[i].ignoreViewport)
+		// Stencil objects
+		if(objects[i].isStencil)
 		{
 		{
-			this.context.setTransform(1, 0, 0, 1, 0, 0);
+			objects[i].clip(this.context, viewport, this.canvas);
 		}
 		}
+		// Drawable objects
+		else
+		{
+			if(objects[i].saveContextState)
+			{
+				this.context.save();
+			}
 
 
-		objects[i].transform(this.context, viewport);
-		objects[i].draw(this.context, viewport);
+			// Set identity if the viewport transform is to be ignored
+			if(objects[i].ignoreViewport)
+			{
+				this.context.setTransform(1, 0, 0, 1, 0, 0);
+			}
 
 
-		if(objects[i].restoreContextState)
-		{
-			this.context.restore();
+			objects[i].transform(this.context, viewport, this.canvas);
+			objects[i].draw(this.context, viewport, this.canvas);
+
+			if(objects[i].restoreContextState)
+			{
+				this.context.restore();
+			}
 		}
 		}
 	}
 	}
 };
 };

+ 38 - 1
source/math/Box2.js

@@ -74,22 +74,36 @@ Box2.prototype.copy = function(box)
 	this.max.copy(box.max);
 	this.max.copy(box.max);
 };
 };
 
 
+/**
+ * Check if the box is empty (size equals zero or is negative).
+ *
+ * The box size is condireded valid on two negative axis.
+ */
 Box2.prototype.isEmpty = function()
 Box2.prototype.isEmpty = function()
 {
 {
-	// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes
+
 	return (this.max.x < this.min.x) || (this.max.y < this.min.y);
 	return (this.max.x < this.min.x) || (this.max.y < this.min.y);
 };
 };
 
 
+/**
+ * Calculate the center point of the box.
+ */
 Box2.prototype.getCenter = function(target)
 Box2.prototype.getCenter = function(target)
 {
 {
 	return this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
 	return this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
 };
 };
 
 
+/**
+ * Get the size of the box.
+ */
 Box2.prototype.getSize = function(target)
 Box2.prototype.getSize = function(target)
 {
 {
 	return this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);
 	return this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);
 };
 };
 
 
+/**
+ * Expand the box to contain a new point.
+ */
 Box2.prototype.expandByPoint = function(point)
 Box2.prototype.expandByPoint = function(point)
 {
 {
 	this.min.min(point);
 	this.min.min(point);
@@ -98,23 +112,45 @@ Box2.prototype.expandByPoint = function(point)
 	return this;
 	return this;
 };
 };
 
 
+/**
+ * Expand the box by adding a border with the vector size.
+ *
+ * Vector is subtracted from min and added to the max points.
+ */
 Box2.prototype.expandByVector = function(vector)
 Box2.prototype.expandByVector = function(vector)
 {
 {
 	this.min.sub(vector);
 	this.min.sub(vector);
 	this.max.add(vector);
 	this.max.add(vector);
 };
 };
 
 
+/**
+ * Expand the box by adding a border with the scalar value.
+ */
 Box2.prototype.expandByScalar = function(scalar)
 Box2.prototype.expandByScalar = function(scalar)
 {
 {
 	this.min.addScalar(-scalar);
 	this.min.addScalar(-scalar);
 	this.max.addScalar(scalar);
 	this.max.addScalar(scalar);
 };
 };
 
 
+/**
+ * Check if the box contains a point inside.
+ *
+ * @param {Vector2} point
+ * @return {boolean} True if the box contains point.
+ */
 Box2.prototype.containsPoint = function(point)
 Box2.prototype.containsPoint = function(point)
 {
 {
 	return point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;
 	return point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;
 };
 };
 
 
+/**
+ * Check if the box fully contains another box inside (different from intersects box).
+ *
+ * Only returns true if the box is fully contained.
+ *
+ * @param {Box2} box
+ * @return {boolean} True if the box contains box.
+ */
 Box2.prototype.containsBox = function(box)
 Box2.prototype.containsBox = function(box)
 {
 {
 	return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;
 	return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;
@@ -124,6 +160,7 @@ Box2.prototype.containsBox = function(box)
  * Check if two boxes intersect each other, using 4 splitting planes to rule out intersections.
  * Check if two boxes intersect each other, using 4 splitting planes to rule out intersections.
  * 
  * 
  * @param {Box2} box
  * @param {Box2} box
+ * @return {boolean} True if the boxes intersect each other.
  */
  */
 Box2.prototype.intersectsBox = function(box)
 Box2.prototype.intersectsBox = function(box)
 {
 {

+ 3 - 1
source/math/UUID.js

@@ -1,7 +1,7 @@
 "use strict";
 "use strict";
 
 
 /**
 /**
- * Implements all UUID related methods.
+ * Class to implement UUID generation methods.
  *
  *
  * @class
  * @class
  */
  */
@@ -11,6 +11,8 @@ function UUID(){}
  * Generate new random UUID v4 as string.
  * Generate new random UUID v4 as string.
  *
  *
  * http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
  * http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
+ *
+ * @static
  */
  */
 UUID.generate = (function ()
 UUID.generate = (function ()
 {
 {

+ 1 - 1
source/objects/Box.js

@@ -50,7 +50,7 @@ Box.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Box.prototype.draw = function(context)
+Box.prototype.draw = function(context, viewport, canvas)
 {
 {
 	var width = this.box.max.x - this.box.min.x;
 	var width = this.box.max.x - this.box.min.x;
 	var height = this.box.max.y - this.box.min.y;
 	var height = this.box.max.y - this.box.min.y;

+ 1 - 1
source/objects/Circle.js

@@ -45,7 +45,7 @@ Circle.prototype.onPointerLeave = function(pointer, viewport)
 	this.fillStyle = "#FFFFFF";
 	this.fillStyle = "#FFFFFF";
 };
 };
 
 
-Circle.prototype.draw = function(context)
+Circle.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.fillStyle = this.fillStyle;
 	context.fillStyle = this.fillStyle;
 
 

+ 1 - 1
source/objects/DOM.js

@@ -38,7 +38,7 @@ function DOM(parent, type)
 
 
 DOM.prototype = Object.create(Object2D.prototype);
 DOM.prototype = Object.create(Object2D.prototype);
 
 
-DOM.prototype.draw = function(context, viewport)
+DOM.prototype.draw = function(context, viewport, canvas)
 {
 {
 	// CSS trasnformation matrix
 	// CSS trasnformation matrix
 	var projection = viewport.matrix.clone();
 	var projection = viewport.matrix.clone();

+ 1 - 1
source/objects/Image.js

@@ -56,7 +56,7 @@ Image.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Image.prototype.draw = function(context)
+Image.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 	context.drawImage(this.image, 0, 0, this.image.naturalWidth, this.image.naturalHeight, this.box.min.x, this.box.min.y, this.box.max.x - this.box.min.x, this.box.max.y - this.box.min.y);
 };
 };

+ 1 - 1
source/objects/Line.js

@@ -44,7 +44,7 @@ function Line()
 
 
 Line.prototype = Object.create(Object2D.prototype);
 Line.prototype = Object.create(Object2D.prototype);
 
 
-Line.prototype.draw = function(context)
+Line.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.lineWidth = this.lineWidth;
 	context.lineWidth = this.lineWidth;
 	context.strokeStyle = this.strokeStyle;
 	context.strokeStyle = this.strokeStyle;

+ 1 - 1
source/objects/Pattern.js

@@ -62,7 +62,7 @@ Pattern.prototype.isInside = function(point)
 	return this.box.containsPoint(point);
 	return this.box.containsPoint(point);
 };
 };
 
 
-Pattern.prototype.draw = function(context, viewport)
+Pattern.prototype.draw = function(context, viewport, canvas)
 {
 {
 	var width = this.box.max.x - this.box.min.x;
 	var width = this.box.max.x - this.box.min.x;
 	var height = this.box.max.y - this.box.min.y;
 	var height = this.box.max.y - this.box.min.y;

+ 1 - 1
source/objects/Text.js

@@ -34,7 +34,7 @@ function Text()
 
 
 Text.prototype = Object.create(Object2D.prototype);
 Text.prototype = Object.create(Object2D.prototype);
 
 
-Text.prototype.draw = function(context)
+Text.prototype.draw = function(context, viewport, canvas)
 {
 {
 	context.font = this.font;
 	context.font = this.font;
 	context.textAlign = this.textAlign;
 	context.textAlign = this.textAlign;

+ 34 - 0
source/stencil/BoxStencil.js

@@ -0,0 +1,34 @@
+"use strict";
+
+import {Stencil} from "./Stencil.js";
+import {Vector2} from "../math/Vector2.js";
+import {Box2} from "../math/Box2.js";
+
+function BoxStencil()
+{
+	Stencil.call(this);
+
+	/**
+	 * Box object containing the size of the object.
+	 */
+	this.box = new Box2(new Vector2(-50, -35), new Vector2(50, 35));
+
+	/**
+	 * If inverted the stencil considers the outside of the box instead of the inside.
+	 */
+	this.invert = false;
+}
+
+BoxStencil.prototype = Object.create(Stencil.prototype);
+
+BoxStencil.prototype.clip = function(context, viewport, canvas)
+{
+	var width = this.box.max.x - this.box.min.x;
+	
+	context.beginPath();
+	context.rect(this.box.min.x - 1e4, -5e3, 1e4, 1e4);
+	context.rect(this.box.max.x, -5e3, 1e4, 1e4);
+	context.rect(this.box.min.x, this.box.min.y - 1e4, width, 1e4);
+	context.rect(this.box.min.x, this.box.max.y, width, 1e4);
+	context.clip();
+};

+ 13 - 0
source/stencil/ResetStencil.js

@@ -0,0 +1,13 @@
+"use strict";
+
+import {Stencil} from "./Stencil.js";
+import {Vector2} from "../math/Vector2.js";
+import {Box2} from "../math/Box2.js";
+
+function ResetStencil()
+{
+	Stencil.call(this);
+}
+
+ResetStencil.prototype = Object.create(Stencil.prototype);
+

+ 15 - 6
source/stencil/Stencil.js

@@ -1,5 +1,9 @@
 "use strict";
 "use strict";
 
 
+import {Object2D} from "../Object2D.js";
+import {Vector2} from "../math/Vector2.js";
+import {Box2} from "../math/Box2.js";
+
 /**
 /**
  * A stencil can be used to set the drawing region.
  * A stencil can be used to set the drawing region.
  *
  *
@@ -11,15 +15,20 @@
  */
  */
 function Stencil()
 function Stencil()
 {
 {
-	//TODO <ADD CODE HERE>
+	Object2D.call(this);
 }
 }
 
 
+Stencil.prototype = Object.create(Object2D.prototype);
+
+Stencil.prototype.isStencil = true;
+
 /**
 /**
- * Activate the stencil.
+ * Clip the canvas context, to ensure that next objects being drawn are cliped to the path stored here.
+ *
+ * @param {CanvasContext} context Canvas 2d drawing context.
+ * @param {Viewport} viewport Viewport applied to the canvas.
+ * @param {DOM} canvas DOM canvas element where the content is being drawn.
  */
  */
-Stencil.prototype.draw = function()
-{
-	// body...
-};
+Stencil.prototype.clip = function(context, viewport, canvas){};
 
 
 export {Stencil};
 export {Stencil};

+ 12 - 2
source/utils/Helpers.js

@@ -3,11 +3,19 @@
 import {Circle} from "../objects/Circle.js";
 import {Circle} from "../objects/Circle.js";
 import {Object2D} from "../Object2D.js";
 import {Object2D} from "../Object2D.js";
 
 
+/**
+ * Class contains helper functions to create editing object tools.
+ *
+ * @class
+ */
 function Helpers(){}
 function Helpers(){}
 
 
-
 /**
 /**
- * Create a rotation tool
+ * Create a rotation tool helper.
+ *
+ * When the object is dragged is changes the parent object rotation.
+ *
+ * @static
  */
  */
 Helpers.rotateTool = function(object)
 Helpers.rotateTool = function(object)
 {
 {
@@ -27,6 +35,8 @@ Helpers.rotateTool = function(object)
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  * Each helper is positioned on one corner of the box, and the value of the corner is copied to the boxes as they are dragged.
  *
  *
  * This method required to object to have a box property.
  * This method required to object to have a box property.
+ *
+ * @static
  */
  */
 Helpers.boxResizeTool = function(object)
 Helpers.boxResizeTool = function(object)
 {
 {

Some files were not shown because too many files changed in this diff