That's right, folks. I have a MUSO on my hands.
So... hi there, first of all. This is my first LUA project, and it's going fairly well so far.
Here's a brief rundown of what I'm doing: I have a script that draws (well, will draw) people to the screen by assembling individual body parts to the right coordinates. The point of this is to allow things such as clothing changes on the fly without having to make more animations.
Now, the problem is that when I flip all of the body parts (by scaling them 1*-1), the torso... for no apparent reason... jumps to the right by ten or fifteen pixels. If I do away with the *-1 that flips the torso, there is no offset. Even when the torso is offset, the biceps and thighs... whose positions are based pretty strictly on the position of the torso... are not offset. I'm sure of two things: Whatever the problem is, it's a stupid, lame oversight... and that I'm going to look and feel like an idiot when it's resolved... but I've re-read my code a million times and for some reason I still can't see it.
Since my work so far is bare-bones and most of it is placeholder anyway, I have no problem with just attaching the .love file.
Any information leading to the arrest of this bug will be rewarded with immense gratitude. Any part of my code that doesn't make sense will be happily explained on the asking.
Mysterious Unwanted Sprite Offset
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Mysterious Unwanted Sprite Offset
- Attachments
-
- argh.love
- (3 KiB) Downloaded 101 times
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mysterious Unwanted Sprite Offset
This is a bug in 0.5.0
Re: Mysterious Unwanted Sprite Offset
Oh. Well.
Hmm.
Okay, well, I guess there must be a work-around, then, because this hasn't been happening the whole time. I'll play around with different sizes for the torso (since that's the only variable between "it's working" and "now").
Thanks for the info!
Hmm.
Okay, well, I guess there must be a work-around, then, because this hasn't been happening the whole time. I'll play around with different sizes for the torso (since that's the only variable between "it's working" and "now").
Thanks for the info!
Re: Mysterious Unwanted Sprite Offset
Rather than working around, why not just use a 0.6 build? I'm using it and haven't had any issues so far, seems 100% stable.
http://love2d.org/forum/viewtopic.php?f=3&t=1016 << epic name!
Re: Mysterious Unwanted Sprite Offset
Okay, you talked me into it.
So I'm halfway into porting this thing and all of my sprites are drawing stark white with no alpha data. Is this something that'll be fixed in the stable release, or is there something different about "draw"?
So I'm halfway into porting this thing and all of my sprites are drawing stark white with no alpha data. Is this something that'll be fixed in the stable release, or is there something different about "draw"?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mysterious Unwanted Sprite Offset
I think this is related to the size of the images, my guess is that the width and/or height are not a power of 2. Some videocards/drivers can't handle this and just.. draw weird data. In the period before a function has been made to accommodate for this (by padding), you can pad the images yourself.
Re: Mysterious Unwanted Sprite Offset
Yup! That was it. Thanks!
I was puzzled because it wasn't happening before I ported from 0.5.0. New graphics system?
I was puzzled because it wasn't happening before I ported from 0.5.0. New graphics system?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mysterious Unwanted Sprite Offset
No, just stopped padding automatically (it might've been the padding that caused the incorrect mirroring in the first place)
Who is online
Users browsing this forum: No registered users and 62 guests