Hey. So this version of 2D sprites in the BGE is kind of a style change, really. In this version, I added another function to implement sprite changing via mesh replacement, rather than UV-coordinate animation called SpriteReplace.
The function's animation arrays look like:
anim = ['Explosion', 0, 1, 2, 3, 4, 5, 6]
In the above example, you would create several (7) planes, each representing a frame of the explosion animation. You would name the meshes according to the animation - the first frame would be 'Explosion0', the second 'Explosion1', the third 'Explosion2', etc. What the script then does is swap out every so often the current frame for the next one in the list, drawing an animation onscreen.
It's working pretty well. The good thing about this method is that you should be able to have added sprites and animations that are unique (as they all don't share animations, just the subimage frames). It's more work to set up, but for duplicated objects, it's a nice little fix for a pretty big problem. Download Sprites V1.7 (Only for Blender 2.5) here.
No comments:
Post a Comment