enchant.js v0.7.0 has been released. Major changes are listed below.
add Entity#intersectStrict (feature/boundingRect #166)
Currently, Entity methods intersect() and within() do not take into account rotation or scaling, and therefore do not function as expected with rotated or scaled sprites. We’ve added the functions getBoundingRect() and getOrientedBoundingRect() to Entity in order to acquire the rectangle of a rotated or scaled sprite. Also, we’ve added the Entity intersectStrict() method in order to calculate collision detection on sprites that have been manipulated in this way.
Note that intersectStrict takes 1.8 – 2.0 times as much time to be processed in comparison with intersect. Since values returned by getBoundingRect and intersectStrict can request values based off of getOrientedBoundingRect, we are tossing around the idea of implementing a cache for the results of getOrientedBoundingRect.
add Deferred class
We have made a usable Deferred object in the style of jQuery.deferred. It is implemented inside of the core enchant.js library. We’ll add more detailed information in a separate blog post.
add LoadingScene class
We’ve added a LoadingScene class. By inheriting this class, the default loading screen can easily be changed.
allows preload alias (feature/asset-name-alias #193)
We’ve extended the Core.preload class to allow for alias names relating to asset file names.
- Core can be resize after being initialized
- added Core resize event
Until v0.6, after reading a new Core() object, resizing it or setting the size of canvas elements has not ben possible. However, from v0.7 on, resizing the screen causes coreresize and dispatch events to be called from the instance of Core, and individual elements can now be resized as well.
improved Group#addChild, insertBefore
In the case of addChild being called on an Entity which is already a member of a parent Group, we’ve added an automatic call to removeChild from the parent. This protects against an Entity being added to multiple groups.
- improved some DOM bugs on Internet Explorer
- miscellanious fixes
removed build files from repository
Due to development bugs, we’ve removed build files for files such as enchant.js and enchant.min.js. Source code for development use can be found inside the dev/ folder of the download package. Also, users of enchant.js can download build files directly from the following link:
grunt v0.4.1 (thanks to @chick307)
We’ve added several new features to the v0.7 line of enchant.js releases. Processing of the main game loop has been optimized and drawing speed has been drastically improved, but there may still be several bugs in this newest version. We will be focusing on resolving several of these bugs in the next release (v0.7.1). For outward-facing or business use, we recomment using v0.6 for now.
Please stay tuned for more release notes.
-The enchant.js dev team