Skip to content

Beta Version 5

Pre-release
Pre-release
Compare
Choose a tag to compare
@Mtax-Development Mtax-Development released this 05 Oct 16:27
· 231 commits to master since this release

The changes in this version overhaul and redesign several parts of the code base, introducing better functionality and user experience.

Every method that returned nothing will now default into returning {self}, a reference to the constructor executing the method. This allows for reliable method chaining. Detailed information about it has been added to the Examples Wiki page.

Constructors which render graphics have a new Event system included. The event struct is declared upon construction and can be directly modified to call methods on specific timing with previously specified arguments. Detailed information about has been added to the Overview Wiki page. Please note that the configurable onCreate method property of the Surface constructor has been replaced by the event system.

This version sees the discontinuation and removal of currently existing Vector2 and Vector4 methods subsidiary to other methods, such as sumX() and sumY() being subsidiary to sum(). The reason for this change is that this format multiplies the development and testing time each time a change or addition of new method is to be made, as well as the whitespace used. Despite that, an example call of Vector4.differenceX(5)[0] is equivalent of calling Vector4.difference(5).x1.


Changes from Beta Version 4:

Changes to the existing content:
| All forEach() methods: Will now return the results returned by the function in an array.
| All methods which returned nothing: Will now return {self}, allowing for method chaining.
| ArrayParser/StringParser: All methods which returned the ID property of the constructor now return {self} instead.
| Surface: Moved the onCreate property to event.afterCreation.callback.
| Vector4.interpolate(): Added a number argument type support.
| Vector4.split(): Moved to the "Conversion" category.
| List.getFirstIndex(): Renamed to getFirstPosition().
| List.getAllIndexes(): Renamed to getPositions().
| List: Reversed the argument order of the set(), replace(), insert() methods.
| Shader.setActive(): Removed the functionality to toggle between the two target states in order to require them being explicitly defined.
| Layer.TilemapElement.setTileInCell()/Layer.TilemapElement.setTileAtPoint(): Moved to the "Execution" category.
| Layer.ParticleSystem.update(): Added an optional argument that specifies the number of steps through which the update will be performed.
| Surface.setTarget(): Renamed to setActive().
| Surface.isTarget(): Renamed to isActive().
| Circle/Point/Rectangle/RoundRectangle/Triangle: Added support for the GUI layer cursor location to cursor getter methods.

Additions:
+ Data Structures: count() method.
+ Color4: split() method.
+ Vector2/Vector4: getMagnitude(), getNormalized(), clampTo() methods.
+ Vector4: mirror(), mirrorX(), mirrorY() methods.
+ Scale: contains(), equals() methods.
+ Shader: updateUniforms() method.

Fixes and removals:
- Vector2: Removed the sumX(), sumY(), differenceX(), differenceY(), productX(), productY(), quotientX(), quotientY(), mirrorX(), mirrorY() methods.
- Vector4: Removed the sumX(), sumY(), differenceX(), differenceY(), productX(), productY(), quotientX(), quotientY(), interpolateX(), interpolateY(), getMiddleX(), getMiddleY() methods.
- Buffer.toFile(): Fixed the asynchronous ID not being returned if the method is specified to be ran asynchronously.
- ArrayParser.clear(): Made the array be resized to the size of 0 if the array exist instead of replacing it with an empty array, so the array will be properly cleared in all variables that are a reference to it.
- Vector4.split(): Now constructs the Vector2 it is supposed to return.
- Shader: Structs properties are now copied instead of referenced on constructor copy.
- General minor code and documentation fixes.

Instructions for conversion from the previous version:
• Adjust all code which relied on methods that returned nothing and forEach() calls to return {undefined} by default, as they return {self} now.
ArrayParser/StringParser: Adjust the code which relied on methods returning the ID property of the constructor directly from the method call to read the ID property of the method call instead.
Surface: Adjust the code which operated the onCreate method to refer to it through the event.afterCreation.callback method instead.
List.getFirstIndex(): Adjust the code to refer to it through its new name, getFirstPosition().
List.getAllIndexes(): Adjust the code to refer to it through its new name, getPositions().
List: Reverse the argument order in calls of the set(), replace() and insert() methods.
Shader.setActive(): Adjust the calls without argument to specify the target state in an argument.
Surface.setTarget(): Adjust the code to refer to it through its new name: setActive().
Surface.isTarget(): Adjust the code to refer to it through its new name: isActive().
Vector2/Vector4: Adjust the code to replace method calls of removed methods that were subsidiary X and Y versions of other methods to refer to the properties of the returned constructor of the method that they were subsidiary to.
ArrayParser.clear(): Ensure that the code related to assigning the ID property of the constructor to a variable before the call of this method works as intended and adjust it if not. All direct references to the cleared array of the constructor will be not cleared if referred to by any variable, instead of only the ID property of the constructor being replaced by a new empty array.
Shader: Ensure that the code related to struct properties of the constructor being operated after it is copied works as intended and adjust it if not. The struct properties are now copied to a separate new struct instead of them being an reference to the struct of the constructor they were copied from.