-
Notifications
You must be signed in to change notification settings - Fork 258
Animated sprites with configurable textures #238
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
Conversation
pablitar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great. We should merge it and test it thoroughly with real world cases!
Feel free to address the comments I made!
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
scenes/game_elements/characters/player/components/player_sprite.gd
Outdated
Show resolved
Hide resolved
c89d990 to
ecfa22f
Compare
|
@JuanFdS did a demo of the current state. It looks very promising! |
a4d1870 to
258e706
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e8bed14 to
4624fe7
Compare
36f4936 to
85c0732
Compare
manuq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuanFdS this is working like a charm! I think it's a great addition that works around a current limitation of the Godot editor: unlike TileSet, the SpriteFrames doesn't expose the used textures. Also requiring that the replaced texture is of the same size is a nice touch.
Can you make it work with SpriteFrames that are saved in the scene too? At first glance I don't see what is limiting the addon to only work with SpriteFrames resources saved in its own separate files.
Can you run the linter and other checks in it? In .pre-commit-config.yaml we have the checks disabled for all addons/ because the only addon is dialogue_manager which we copy and patch. I have opened #464 for this. If I add that commit on top of this PR and then run pre-commit run --all-files I get a number of issues.
| else: | ||
| var message_label := Label.new() | ||
| message_label.autowrap_mode = TextServer.AUTOWRAP_WORD | ||
| message_label.text = "⚠️ SpriteFrames must be saved to a file in order to edit its textures" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this limitation. Can you explain why the SpriteFrames resource has to be saved to a file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems it can!, in a previous version, making the file unique and modifying it was causing issues, but it seems it doesn't now, so this limitation isn't needed, thanks for pointing that out!
85c0732 to
b4a0ee6
Compare
The addons affects any SpriteFrames resource by exposing some 'virtual' properties (one for each texture used in the SpriteFrames) in the inspector, and if any of those texture is changed, it updates every animation in the SpriteFrames that used accordingly. The way to access those properties is either by expanding the SpriteFrames that are exposed by any object, or by opening a SpriteFrames resource directly in godot. Added some safeguards: - only lets users swap a texture by another texture of the same size. - doesn't let the user swap a texture by an already used texture (this messed up undoing the operation). - doesn't let the user clear the texture. Fixes #173
b4a0ee6 to
93c9c8c
Compare
Proposed workflow for learner making their own spritesheet
There are actually 2 valid ways of creating a new spritesheet:
Then, once the new spritesheet is created, it's just either dragging a texture to the one that the user wants to swap.
Grabacion.De.Pantalla.2025-05-06.103910.mp4