0 votes

I have a lot of items and I would rather have a spritesheet than 500 png images. In the item dictionary I can specify the Vector2() for the top left corner and Vector2() for the bottom left corner for the part of the spritesheet I want. If this achievable how can I do this?

in Engine by (450 points)

2 Answers

+1 vote
Best answer

If your texture is not exactly a spritesheet you can still change the region, see the Region category in the inspector when your sprite is selected.
If you use the same region often, you can make it an AtlasTexture as well.

by (28,882 points)
selected by
+1 vote

If you have a Spritesheet as the Texture property of a Sprite node. Then you just need to adjust the VFrame and HFrame properties under the Animation tree.

Additionally, you can adjust the animation using an AnimationPlayer or via code (by changing the VFrame and HFrame property).

enter image description here

by (43 points)

Thanks for the answer, it is working great!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.