components & core API upgrades
This release aims to solidify the Core API of raster.js, by better defining semantics of how rendering works, and rewriting many of the Components used by the renderer. In addition there are bug fixes for specific runtime environments and a couple of new features.
Features:
- Multiple layers work on webgl display
- ImageLoader can load images using an alias
- Events: click with region, and sendMessage
- Polygon objects can be constructed with a center point
Core API improvements:
run
method only, no moreshow
. If thedrawFunc
given torun
is null, the display will render once, then stop the main loop- runFrame can be called to re-render. This is an efficient way to only render when changes occur.
paste
method, renamed fromdrawImage
. This method can accept selections, tiles, or any Plane, not just Imagesxform
method- can flip a Plane horizontally or vertically
fillFrame
:traverse
andbuffer
optionssetColor
andfillColor
must get numbers- selections can have names
Environments:
- Node.js
- SDL is optional, the default
http
display works without it, as does --save - optional instrumentation of SDL loop
- --time-tick command-line option
- --save on command-line will composite layers
- SDL is optional, the default
- Web
- inspector will keep re-rendering components
- fix race condition caused by document.readyState bug
Components:
- Palette
- removed the colorMap component, just use the palette's rgbmap
- added the concept of
entries
, which mirror how the old palette used to work - easier cycling using
palette.cycle
andlook
andupon
- Tileset
addFrom
method, returns PatternTablefill
,put
,serialize
,fillPattern
methods- serialize & deserialize
- Sprites
- render sprites with a lower index on top
- Display
- better API for custom displays
- Colorspace
- renamed from attributes
fill
,put
,fillPattern
methods