Kenney spritesheets

Godot Version

4.2.2 stable

Question

hello, I’m using the robots pack created by kenney, and I’m having trouble importing the sprites. i can use the PNGs fine, but i can’t get the sprite sheet to line up due to the irregularities. how would I import this?

They are pretty unique for that. There is a plugin on the AssetLib called Kenney Spritesheet Importer that helps, assuming the robots sprite sheet pack comes with an xml texture atlas.

I’m unfamiliar with godot plugins, do I just drag and drop the files, or do I have to do something else?

Easiest way is from the AssetLib view, search for Kenney and click download.

I’m confused as to how the plugin is supposed to work, how do you use it? (I read the readme, I just don’t understand the instructions. when/where is the option supposed to appear?)

I think he want to tell you that to download the plugin from assets lib that is on the fourth tab, on the column of 2d, 3d, script and then asset lib section at the top bottom of the Godot editor. And if you already downloaded that add-on from external source, then you can just drag the addons folder and drop it in the file manager of Godot

I have the plugin installed, I’m just not sure how to use it, should have been clearer

The Kenney Spritesheet Importer works great. Here is how to install addons.

You search for it

search-addons

Enable the plugin from the plugins menu button

Then you go to your filetree, and select the spritesheet you want. The Import tab shares the same space as the Scene tab by default, so toggle the Import tab on. By default PNGs are imported as Texture2D. Click the dropdown and it should offer you the Kenney Spritesheet option. Click it and hit Reimport at the bottom.

import-menu

This will create a subfolder with the name of the spritesheet. And inside there are the images as .tres files. From what I can see they have the correct dimensions. You can arrange them into animation frames or something

1 Like

is there any way to make these images into a spritesheet automatically, or do you have to do that manually? what’s the benefit of using the .tres files vs using the PNGs the provided?

I think by this you mean to join the standalone images into a bigger, spritesheet image? You can automate that with a python script pretty easily. Kenney is amazing enough that he gives you the XML to go along with the spritesheets. Parse that and merge those bad boys as you wish :smiley:

Now that I’m looking at what this plugin does I’m not sure if it’s worth to use it. It encodes the entire PNG image as text into the .tres file, which means it takes a lot more space.

:warning: :warning: :warning: By that I mean the spritesheet_robotsSide.png has 92KB as a PNG and all the .tres files generated from it have 442M all together. That’s crazy town. Just for this reason I’d go for something different. Just write a one-time use python script I’d say.