GDevelop-extensions icon indicating copy to clipboard operation
GDevelop-extensions copied to clipboard

New extension: Dynamic tiled sprite changer

Open github-actions[bot] opened this issue 1 year ago โ€ข 1 comments

Description

Dynamic tiled sprite changer

With this tool you will be able to change the sprites of your objects dynamically, which will allow for various business rules, such as a floor that changes theme automatically or skins for your character. The possibilities are immense.

This extension was made thinking about the template that I will soon sell for a complex character customization scene for RPG.

The extension is for community and non-profit use, please use it giving due credit to me and @arthuro555 who made the extension I based it on "Load images from a URL". My thanks @arthuro555.

How to use the extension

To use it you only need a TiledSpriteObject and in the event sheet you must go to another actions in the advanced area and click on Change TiledSprite Dynamic and then on Load Path/URL into a tiled sprite. Here you must define the sprite that will be used, its dimensions and the tiled object that will be modified. You must also mark whether or not it will be modified. After these definitions you must follow your business rule, in my tests I am using it for a complex character creation scene for RPG that I will soon sell as a model. (the use of the extension is completely free and I thank @arthuro555 for making the "Load images from a URL" extension that helped me in the beginning) in the same way as this extension, the address of the sprite that will be used must be a URL, I still haven't been able to make the image using the relative path "assets/image.png" work and anyone who can help me should contribute the extension.

Checklist

  • [X] I've followed all of the best practices.
  • [X] I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • [X] I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

DynamicTiledSpriteChanger-DEMO.zip

Extension file

DynamicTiledSpriteChanger-extension.zip

github-actions[bot] avatar Jan 09 '24 21:01 github-actions[bot]

Thank you for submitting an extension.

A resource parameter can be used instead of an URL. It allows the game to pre-load images in background. You will need this class:

  • https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.PixiImageManager.html

An instance can be get like this: runtimeScene.getGame().getImageManager()

If you want to add the action directly in GDevelop, take a look to this PR, it will help to understand how actions are declared:

  • https://github.com/4ian/GDevelop/pull/5558

D8H avatar Apr 06 '24 09:04 D8H