2d Sprites

Hi,
I have a question regarding 2d planes/sprites.

I am looking for built-in support for animated sprites in Panda3d. I am locked into panda 1.32, so my question is based around the restrictions in this release.

The only way I have found to swap out textures in a sequence and have control of the FPS etc is the binary file egg-texture-cards, or to write my own sprite engine. I don’t have the time for the second option so I am looking to for something already built in.

The issue that I am running into with the egg-texture-cards binary is that I cannot control which frame it starts on after it is activated the first time. The supplied code in the manual also doesn’t exist for this release so setting a default start frame is out.

Any help is appreciated, thank you.

Well, you could also use a quad to play AVI files. Or use the code from one of the texture swapping sample programs.

Hmm, actually, the manual looks to be woefully out of date. The setVisibleChild() interface it describes hasn’t existed since Panda3D 1.0. Ever since Panda3D version 1.1, the new interface has been more similar to the Actor code:

flipNode = flip.find('**/+SequenceNode').node()
flipNode.play(startFrame, endFrame)

You can also do things like flipNode.pose(startFrame); flipNode.loop(0) to start at startFrame and continue to loop from the beginning.

David

See the description for AnimInterface in the generated docs for the full list of controls you have on the SequenceNode.

David