GUI node to display the Sprite sheet frame
Asked Answered
G

3

0

Which GUI node can control the display of a sprite sheet by set current frame like Sprite2D, I have a Sprite Sheet, each frame is an item icon, change the icon by changing the current frame, or do I want to use a Control node with a Sprite2D?

Glace answered 11/1, 2023 at 2:50 Comment(0)
J
0

I'm not entirely sure what you are asking here. Are you looking to use a Control node type as if it was a Node2D? If so then extending a ColorRect and giving it a custom shader might do in visual terms. How well that might work in combination with collision shapes and such tho I'm not sure since I haven't really experimented with that.

Juliusjullundur answered 11/1, 2023 at 7:19 Comment(0)
G
0

Juliusjullundur I apologize my question was not clear,I have an item icon sprite sheet, I want to find a GUI node that can set a current frame like Sprite2D to control the display of the sprite sheet, for the purpose of displaying an item icon, or use Control Node with Sprite2D?

Glace answered 11/1, 2023 at 8:41 Comment(0)
J
0

Glace Well, a ColorRect with a custom shader might do. A TextureRect might work too, though I don't think it can really use a spritesheet like a Sprite2D node would, but again I guess a custom shader might resolve that. Or you could just try using a Sprite2D or AnimatedSprite2D node itself. I think that can work, been a while tho since I've tried anything like that mixing Control and Node2D's like that.

Alas, I'm using an arch based linux distro and because of a system library bug can't currently run godot 4 to double check.

Juliusjullundur answered 11/1, 2023 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.