Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load textures from a spritesheet in Godot 3

Tags:

godot

I've just got started with Godot yesterday, and I'm starting a game. I drew a few spritesheets for it. It seems much more efficient to pack all of the frames of an animation into a single image file, right?

Anyway, in Godot I have an AnimatedSprite, who of course has a SpriteFrames property, or whatever it's called. I want to split my spritesheet up into multiple images so that I can use each image as a separate frame in the animation, but as far as I can see Godot provides no such feature. Is this the case?

I've been searching for an answer on the web for a while now, and I can't find anything relevant.

I'd be very surprised if I can't do this in Godot, since I can do it in just about every other game engine I've seen.

Thanks!

(Just to clarify, I want to (programmatically or otherwise,) split a spritesheet into multiple textures, within Godot.)

like image 432
Jacob Garby Avatar asked Nov 18 '18 14:11

Jacob Garby


1 Answers

Click New SpriteFrames in the Frames property menu of the AnimatedSprite node. Now click on the just created SpriteFrames next to the name of the Frames property. Animation Frames window should appear.

Animation frames window screenshot

Click this Add frames from a Sprite Sheet button. Select your spite sheet file, set grid sizes and finally select individual frames from that sprite sheet.

(This works for me in Godot v3.2.2)

like image 101
Oliort UA Avatar answered Oct 04 '22 02:10

Oliort UA