Release Candidate 3
Pre-releaseThe 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 thecallback
property, withargument
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 thecallback
property.
| Event system: Changed the event property copying code in "Construction copy" construction type to be generically copy each property of theevent
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 thepart
argument of the "From Surface" construction type, using which will cause the entireSurface
area to be used to create theSprite
.
|Sprite
: Merged therenderSize()
,renderPart()
andrenderGeneral()
methods into therender()
method and added the support for theorigin
andtarget
arguments.
|Surface
: Merged therenderSize()
,renderPart()
method into therender()
method and added support for theorigin
argument.
|SpriteRenderer
: Added support for thepart
,origin
andtarget
arguments.
| General code and documentation changes.Additions:
+Vector2
/Vector4
:getSign()
method.
+Vector4
:sort()
method.
+Sprite
:setOrigin()
method.Fixes:
-Font
: Fixedevent
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 theSprite.render()
method instead.
•Surface.renderSize()
/Surface.renderPart()
: Adjust the code and argument usage to use theSurface.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 thelocation
argument values being lower than the first or the values of thescale
argument being negative, adjust thelocation
using theVector4.sort()
method or the values of thescale
argument, so the rendered graphic is not mirrored.