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:
runmethod only, no moreshow. If thedrawFuncgiven torunis 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.
pastemethod, renamed fromdrawImage. This method can accept selections, tiles, or any Plane, not just Imagesxformmethod- can flip a Plane horizontally or vertically
fillFrame:traverseandbufferoptionssetColorandfillColormust get numbers- selections can have names
Environments:
- Node.js
- SDL is optional, the default
httpdisplay 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.cycleandlookandupon
- Tileset
addFrommethod, returns PatternTablefill,put,serialize,fillPatternmethods- serialize & deserialize
- Sprites
- render sprites with a lower index on top
- Display
- better API for custom displays
- Colorspace
- renamed from attributes
fill,put,fillPatternmethods