Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This extension adds skew and shear transformation capabilities to 2D objects in GDevelop. You can distort objects by slanting them along the X or Y axis, which transforms rectangles into parallelograms. This is useful for creating visual effects such as perspective distortion, speed motion, wind effects, or artistic stylization in your games. The extension automatically converts between radians used internally by PixiJS and degrees for easier use by developers.
How to use the extension
To use the Skew 2D extension in GDevelop, first install the extension and add it to your project. Once added, select any 2D object in your scene that you want to skew. In the Events Editor, use the actions provided by the extension, such as Set Skew X or Set Skew Y. Enter the skew angle in degrees. Positive values will tilt the object in one direction, while negative values will tilt it in the opposite direction.
You can retrieve the current skew of an object using the SkewX and SkewY expressions. These expressions return the skew angle in degrees and can be used in calculations, conditions, or displayed using text objects.
Checklist
Example file
[SkewExtension.zip] (https://github.com/user-attachments/files/24200623/SkewExtension.zip)
Extension file
Skew2D.zip
Extension by @Carrotstudio0
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!