Scrawl.js - demonstration 007

Scrawl entitys: stamping methods

Extensions: block, phrase

Scenario: demonstrate 8 of the possible 'method' stamping actions for a Block sprite

Actions:

  1. define an array of 'method' attribute strings
  2. set the canvas base Cell's background color attribute, and compile it using Pad.compile()
  3. create a template block sprite, styling it with an offset shadow and different fill and stroke colors
  4. create a template phrase sprite; position the phrase relative to the block sprite using 'pivot' and 'handleY' attributes
  5. stamp the Block and Phrase sprites onto the canvas repeatedly (using Block.stamp() and Phrase.stamp()), iterating over the 'method' array to amend the templates' attributes (using Block.set() and Phrase.set())
  6. display the final results using Pad.show()

Known browser issues: none

Result images:

image of expected test result