Skip to content

New extension: Dynamic tiled sprite changer #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 9, 2024

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

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • 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 github-actions bot requested a review from a team as a code owner January 9, 2024 21:06
@github-actions github-actions bot added the ✨ New extension A new extension label Jan 9, 2024
@VegeTato VegeTato added the 👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. label Mar 22, 2024
@D8H D8H added the ⌨ JavaScript Uses JavaScript code, and thereby needs a reviewer who knows JavaScript. label Apr 6, 2024
@D8H
Copy link
Contributor

D8H commented Apr 6, 2024

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:

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. ⌨ JavaScript Uses JavaScript code, and thereby needs a reviewer who knows JavaScript. ✨ New extension A new extension
Projects
Status: Needs changes
Development

Successfully merging this pull request may close these issues.

3 participants