-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frames are 1 pixel smaller than they should be #5
Comments
Random guess: Your xleft and ytop are 1 too little (0, 0 is the top left corner of the sheet, not 0, 1) I did notice that one image I was using had a horizontal strip missing in the middle, so I'll have to look into and patch/optimize that. |
Both are 0 :x |
Yeah, looking at this it seems like it's an issue with sf2d which is odd because it only happens with certain sprites (for me, link's standing left/right sprites). I'll do some investigating later |
Please do because it's an annoying bug D: I tried looking on the source what the issue could be but found nothing... Also, I've noticed that when drawing an animation, the X and Y are sort of offset compared to drawing a spritesheet at the same X and Y. You might want to check that out... |
This is because drawing a spritesheet at a given position makes that position the top left while an animation makes that the center. I did this because typically you're not really drawing your whole spritesheet as a character and instead just for testing, so there's no reason to get the position perfect. On the other hand, drawing an animation with the hotspot being in the top left corner can get irritating to recenter, so making the hotspot located at the center is more convenient. I'll add some notes to the card on Trello for some thoughts that I want to look into. I really appreciate your patience with how slow I've been on getting this bug fixed and getting new features added, it's just that school takes up a ton of my time and I would rather get as far ahead on that as possible before getting caught up in a side project. |
Don't worry, thank you for the effort! It makes homebrew developing a million times easier considering the lack of documentation of citro3d and such. I'll probably end up contributing some code, I have a few ideas. I got it to work on C++ so I'll probably commit the changes later. |
I think it might be because you draw the frames from it's center compared to normal spritesheets, when you divide by half the width and height and the frame size is an odd number (like 13 or 15) you get a number with a .5 decimal, like 6.5 or 7.5, and when you draw a sprite in that position you get a skewed sprite since the x and y positions should never have decimals. Just have to put a floor() in the right place, I think. |
Hey, I'm not dead. Just in college. So it turns out this is caused by an issue in sf2d (I looked in SpriteTools for like 30 minutes and couldn't see anything changing width/height or positions in the function chain). This means it'll only truly be fixed once I rewrite the low level graphics portion of ST which probably won't happen for a while. In the mean time, I added a janky "fix" that just rounds the width and height up to the nearest even number. Is this a really stupid thing to do? Yes. Does it work well enough? Also yes. |
I'm importing frames and if the frame is supposed to be 13x13, I get an image that's 12x12. Why is that?
The text was updated successfully, but these errors were encountered: