How do I use a Sprite Map in Love?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: How do I use a Sprite Map in Love?

Post by miko »

enderspike wrote:Bad ass. Progress is being made! Now, how do I know which co-ordinate is what in the image? Like, how do I figure out what numbers to put in to get the part of the map I want?
You either make your spritesheet even-spaced, or store coordinates of each frame/image in external map file (which is just a plain text file). So in your case you need to:
1. create map file
2. change your spritesheet image
3. use only those evenly-spaced frames from existing image

I am attaching my modified example from here https://github.com/miko/Love2d-samples/ ... priteSheet, it does not work that nice, but will give you a start.
Attachments
SpriteSheet_crono.love
(48.48 KiB) Downloaded 121 times
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
enderspike
Prole
Posts: 10
Joined: Tue Oct 11, 2011 6:37 pm

Re: How do I use a Sprite Map in Love?

Post by enderspike »

Totally got it, thanks to you! I am a better programmer than before.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests