Hi, new to love2d, and having a little trouble understanding using quads with a spritesheet. I can use love.graphics.draw to show the whole sheet, but quads don't show up.
Adjusted image in Gimp to 256x256 as per a post about non-2* image having trouble with some video cards (mine is a GT430, which shouldn't be a problem), and tried different file formats (png, jpg, bmp).
Probably an embarrassingly easy answer, but I'm stumped. Thanks!
[Solved] quad spritesheet assistance
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Mon Dec 26, 2011 4:40 am
[Solved] quad spritesheet assistance
- Attachments
-
- ty4helping.love
- quads aren't working
- (8.72 KiB) Downloaded 177 times
Last edited by walking_post on Wed Dec 28, 2011 12:01 pm, edited 1 time in total.
Re: quad spritesheet assistance
you are doing it wrong
A) until you figure it out use no padding so your spritesheet looks like this
B) the last 2 arguments of quad is not ever going to be 0,0 its the total size of your image
putting those two together ends up looking like
player = love.graphics.newQuad(0, 0, 55, 30, 111, 60)
which works fine to display the first quad
its startX,startY, width, height, total imageX, total image Y
have fun!
A) until you figure it out use no padding so your spritesheet looks like this
B) the last 2 arguments of quad is not ever going to be 0,0 its the total size of your image
putting those two together ends up looking like
player = love.graphics.newQuad(0, 0, 55, 30, 111, 60)
which works fine to display the first quad
its startX,startY, width, height, total imageX, total image Y
have fun!
-
- Prole
- Posts: 2
- Joined: Mon Dec 26, 2011 4:40 am
[Solved] Re: quad spritesheet assistance
Wow, that's easier than what I was trying to do...lol. Thank you, osgeld!
quad = love.graphics.newQuad( x, y, width, height, sw, sh )
x, y = starting point of sprite
width, height = just the w/h of the sprite, not the x/y coordinates of the sprite's corner
sw, sh = total size of the spritesheet
quad = love.graphics.newQuad( x, y, width, height, sw, sh )
x, y = starting point of sprite
width, height = just the w/h of the sprite, not the x/y coordinates of the sprite's corner
sw, sh = total size of the spritesheet
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests