v0.2.0
Breaking Changes
This release includes several breaking changes:
- The acetate namespace is now lowercase, following standard module convention. Anywhere you configured a setting or called an acetate function, you'll need to update your code.
Acetate.setFocus(mySprite)
→acetate.setFocus(mySprite)
Acetate.drawCenters = false
→acetate.drawCenters = false
- etc.
- Acetate must now be manually initialized by calling
acetate.init()
. Settings can now be overridden by providing a table of settings values when callinginit()
. See the README for more details. - The relative center substitution string, formerly
$co
, is now specified as$rc
.
Features
- The [p]ause keyboard shortcut now works even when debug mode isn't active. Pausing will implicitly enter debug mode.
- Focused sprite bounds are now shown in an animated dashed line. (This can be disabled via the
animateBoundsForFocus
setting.) - Added sprite extensions
getLocalOrigin
andgetWorldOrigin
which return the top left corner of the sprite in local or world space. Substitution strings for these values are also provided for use in debug strings:$o
: local origin coord$ox
: local origin x$oy
: local origin y$O
: world origin coord$Ox
: world origin x$Oy
: world origin y
- Debug strings now support an opaqueness substitution. Use
$q
to output either "OPAQUE" or "TRANSPARENT" indicating whether the sprite is set to be opaque. - Added luacheck support. Run
luacheck *.lua
in the top-level directory. - Added unit tests via luaunit.
- A hint is now printed in the console when acetate is initialized to indicate how to toggle debug mode.
Fixes
- Both
pause
andunpause
now work properly even whenplaydate.gameWillPause
andplaydate.gameWillResume
aren't implemented. - State is preserved properly even if
pause
(orunpause
) is called multiple times in a row. - The
setFocus
function now respects thefocusInvisibleSprites
setting. - Fixed
getWorldCenter
, which was actually returning the top left coordinate, not the center point. focusedSprite
is no longer included in settings, as this is an implementation detail.