Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Sprites resizing and putting on sprite sheet

AGK Backer
Years of Service
User Offline
Joined: 2nd Jun 2011
Location: Burton-on-Trent, uk
Posted: 1st Nov 2013 18:55

I have used sprite sheets and sprites when using tutorials and understand how the programming works.

My problem is, how to use other peoples sprites, these sprites are of different sizes ie 54 X 54 and 40 X 40. What I want to do is get a sprite sheet of the size of 32 X 32 which I can load into my program as its a tile based game i'm wanting to create. I could try using gimp to alter each sprite and then create a sprite sheet but I was wondering if there is any software that could load in these sprites and create a sprite sheet.
Also does altering the sprite sizes cause any problems with resolutions?

Many thanks

DBPro Master
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Dec 2013 00:49
Well a sprite sheet is just a collection of sprites combined into a single image. So if you have a sprite sheet at 512x256 then you can cut out 16 by 8 different sprites of 32x32 pixels in size.

I wrote a function which will take a spritesheet and cut out the individual sprites into separate images. It's a simple idea and uses memblocks, but I don't know what your current level of DB understanding is.

Are you asking how to combine multiple 32x32 sprites into a sheet? If so then yes you can use gimp to piece them altogether.

Quote: "Also does altering the sprite sizes cause any problems with resolutions?"

Changing the size does a few things. Firstly, enlarging any sprite is going to reduce the quality of it. That's just what happens when you enlarge any image. Also, changing the size may require you to alter your code. If your program expects tiles to be a certain size for a tilemap, your spritesheet is going to be cut up to match that size.

Quote: "how to use other peoples sprites, these sprites are of different sizes ie 54 X 54 and 40 X 40."

You have two options. Either resize the images to fit the tile size that your game uses, or adapt your game code to use the different size tiles.

Van B
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Dec 2013 14:02
Sometimes it's better if you use tiles that are bigger, say 48x48, with your 32x32 tile sprite in the middle. This is more of a burdon on performance, but as a lot of the extra 16 pixels will be transparent, it might depend on what your programming in.
With 48x48 sprites, you would still use a 32x32 grid, just decrease the position by 8, giving a an 8 pixel border around the tile. It would support the 40x40 sprites then, if you really need 54x54, then you'd have to go to 64x64 sprites really.
With bigger sprites than the grid, you can do better tile transitions, have tiles with edges that overlap, have foliage for example on a grass platform.

It can be really tricky to work with sprite sheets, I suggest picking a standard and sticking to it - even if it means you can't use some of the tiles you already have.

I am the one who knocks...

Login to post a reply

Server time is: 2024-02-23 23:42:54
Your offset time is: 2024-02-23 23:42:54