Page 1 of 1
(fixed) Trouble getting dsb_animate to work..
Posted: Sun Sep 02, 2007 5:34 pm
by Joramun
I'm polishing my two-handed axe by adding some custom graphics,
I have a few separate bitmaps (axe icon, dungeon view, and fly forward, backward and sideways).
Now that I've managed to get the "invisible color" to work, I want to get the flying animation to work, but I have no idea how to do that...
Posted: Sun Sep 02, 2007 8:42 pm
by Sophia
dsb_animate requires that all frames of animation be put together in a sort of "strip," so if your axe has four frames of animation, they should all be in a row.
Then you can do dsb_animate(your_bitmap, 4, delay). Since you've specified 4 frames, then dsb_animate will divide your image into four sections of equal width and show each section in turn, forming the animation.
At the present time, DSB doesn't support making animations from separate images. (though this can change if there is demand for it, of course)
Does this help?
Posted: Sun Sep 02, 2007 8:52 pm
by Joramun
I supposed it was something like that but I wasn't sur of how the frames specified.
Thanks a lot !

Posted: Mon Sep 03, 2007 11:15 am
by Joramun
Hmm, the animation works almost fine, but it seems the frames cutting is not what I expect :
My axe is on a bitmap of 272 pixel width (4x68)
I copy pasted the four views with the same width, but it seems that in game the frames are overlapping (the edge of another appears at some animation steps) though on the bitmap they are not ! So I suppose the engine takes larger cuts than exact ones, and it might be because of the distance-scaling algorithm.
Posted: Mon Sep 03, 2007 6:42 pm
by Sophia
Hmm...
If you'll send me the bitmap(s) I can take a look at what's going on.

Posted: Mon Sep 03, 2007 8:40 pm
by Sophia
Ok, as we talked about in flashchat, the problem was that the slices were too
small, because of rounding errors.
You'll still get them if the original bitmap isn't divisible by the number of frames, but I've changed to algorithm to cut the bitmap and then scale it, rather than trying to cut a scaled bitmap.
If that doesn't make any sense, don't worry about it. The short answer is that I fixed the problem you were observing.

Posted: Mon Sep 03, 2007 8:56 pm
by Joramun
It makes perfectly sense !
Hah ! This terrible bug was impeding my creative activities !
ok, i was just using some graphics from another game
Next weapon I will make : longspear !