Sprite Constructor

Hello again!

I've been experimenting with the sprite functionality. It seems really solid, except one thing.

1. I create a sprite with the following code:

Sprite sprite = new Sprite("Sprites/man.png", true, new Size(32, 32));
sprite.AnimationType = SpriteAnimType.PingPong;
sprite.TimePerFrame = 250;
sprite.StartAnimation();

man.png is a 96x32 pixel png you can find here: http://i91.photobucket.com/albums/k289/caeonosphere/man.png

The constructor only finds one frame in the png. If I change it to Size(31,31) it finds all three, but each frame is missing a pixel in each dimension.

Also, it also seems like SpriteAnimType.PingPong crashes the sprite if it only has one frame.

One last question: I've enabled VSync, but the FPS counter is still reading out values in the 80-90 range. Is that just a false reading, or is VSync not limiting the framerate?

Sorry to be such a pest. AgateLib seems like a great fit for my current project, and I just want to be sure it has everything I need before I dive in.

Thanks,
Tom

kanato
Posted - Wed, 04/15/2009 - 17:43

Ok, I've confirmed both of the issues with Sprite as bugs, and they are now fixed in SVN #871. Are you using the released version of the SVN version? As a work around I can suggest you make your image at least one pixel taller (96x33) but less than a whole sprite frame taller.

On the VSync issue, there are a lot of things that can affect that. Which driver are you using (AgateDrawing, AgateOTK, AgateMDX)? AgateDrawing will be fairly slow and completely ignore VSync, so if you get 80-90 with not much drawing on the screen regardless of what VSync is, that's not surprising. Otherwise for AgateOTK and AgateMDX they should be synced to the vertical refresh, but this setting can be overriden by your video driver.

Oh, and don't feel bad about asking questions. The feedback is important, especially bug reports, and often times it helps me to see what part of the documentation needs to be improved.

caeonosphere
Posted - Wed, 04/15/2009 - 19:57

For VSync, I was using AgateOTK. It could have been an issue with the crappy computer I was on, because on the machine I'm running right now it's running perfectly.

It seems to me like the best feature of this library so far is the great support. It's nice to see it's being actively developed, and that the concerns of the growing community are being taken into account.

Tom