Skip to content

Release Candidate 3

Pre-release
Pre-release
Compare
Choose a tag to compare
@Mtax-Development Mtax-Development released this 05 Feb 17:55
· 171 commits to master since this release

The changes in this version focus on reducing the complexity of Sprite/Surface rendering and supplementing their feature set, as well as introducing new functionality to the Event system.

The renderSize(), renderPart() and renderGeneral() methods have been merged into the render() method, now having all of their features. It can now stretch or render a part of the graphic, while still being able to use rotation, origin point and Color4 blending, depending on the specified arguments. Furthermore, the target argument allowing for selection of the target Surface of the Surface.render() method was also carried over to the Sprite.render() method. This allows both of these constructors to render in the same way, aside from the frame argument in case of Sprite. The SpriteRenderer constructor was updated to support these changes.

The Event system now can execute multiple methods specified in an array, in order as they are in that array. One argument can be provided for all of these methods or they can be provided in an array, with each its position being provided to each respective method.

The changes to the Event system and SpriteRenderer should work with existing code for previous versions featuring it, but it is recommended to take extra care while conversing to the new usage scheme of the render() methods of Sprite and Surface constructors, as not only the renderSize(), renderPart() and renderGeneral() methods were removed, but also the Surface.render() method features a new argument order.


Changes from Release Candidate 2:

Changes to existing content:
| Event system: Added support for specifying multiple functions in an array in the callback property, with argument property being provided to all of them or if it is an array, each its value being provided to the function at the respective position of the array in the callback property.
| Event system: Changed the event property copying code in "Construction copy" construction type to be generically copy each property of the event struct.
| Vector2/Vector4: Made the first construction argument being {undefined} no longer prevent construction of subsequent values.
| Sprite: Added support for the {all} keyword for the part argument of the "From Surface" construction type, using which will cause the entire Surface area to be used to create the Sprite.
| Sprite: Merged the renderSize(), renderPart() and renderGeneral() methods into the render() method and added the support for the origin and target arguments.
| Surface: Merged the renderSize(), renderPart() method into the render() method and added support for the origin argument.
| SpriteRenderer: Added support for the part, origin and target arguments.
| General code and documentation changes.

Additions:
+ Vector2/Vector4: getSign() method.
+ Vector4: sort() method.
+ Sprite: setOrigin() method.

Fixes:
- Font: Fixed event struct properties not being duplicated in "Constructor copy" construction type.

Instructions for conversion from the previous version:
Sprite.renderSize()/Sprite.renderPart()/Sprite.renderGeneral(): Adjust the code and argument usage to use the Sprite.render() method instead.
Surface.renderSize()/Surface.renderPart(): Adjust the code and argument usage to use the Surface.render() method instead.
Sprite.renderSize()/Sprite.renderPart()/Sprite.renderGeneral()/Surface.renderSize()/
Surface.renderPart(): If the rendering relied on that these method not supporting the graphic being mirrored due to values of second set of the location argument values being lower than the first or the values of the scale argument being negative, adjust the location using the Vector4.sort() method or the values of the scale argument, so the rendered graphic is not mirrored.