API Docs for: 6.0.1
Show:

scrawlCore Module

scrawlCore

Version 6.0.1 - 14 January 2017

Developed by Rik Roots - rik.roots@gmail.com, rik@rikweb.org.uk

Scrawl demo website: http://scrawl.rikweb.org.uk

Purpose and features

The core module is the only essential file in Scrawl. It must always be directly, and completely, loaded into the web page before any Scrawl extensions are added to it.

  • Defines the Scrawl scope - window.scrawl

  • Defines a number of utility methods used throughout Scrawl.js

  • Defines the Scrawl library - all significant objects created by Scrawl can be found here

  • Searches the DOM for <canvas> elements, and imports them into the Scrawl library

  • Instantiates controllers (Pad objects) and wrappers (Cell objects) for each <canvas> element

  • Instantiates Context engine objects for each Cell object

  • Defines mouse functionality in relation to <canvas> elements

  • Defines the core functionality for Entity objects to be displayed on <canvas> elements; the different types of Entitys are defined in separate extensions which need to be loaded into the core

  • Defines Group objects, used to group entitys together for display and interaction purposes

  • Defines Design objects - Gradient and RadialGradient - which can be used by Entity objects for their fill and stroke styles; additional Design objects (Pattern, Color) are defined in separate extensions

Loading the module

Example:

<script src="path/to/scrawlCore-min.js"></script>