QwSpriteField Class Set
The QwSpriteField Class Set is a collection of classes supporting
multiple simultaneous flicker-free displays of efficiently redrawn continuous
and non-continuous animated areas with the
Qt GUI Toolkit.
Animated areas are two-dimensional rectangular areas upon which
two-dimensional masked raster images are in motion.
Applications vary from computer games to simulations.
What's New?
Version 1.4
- New QwTextSprite!
- Sequences can now be made from pixmaps!
- Velocities available from mobile sprites.
- More double-buffering possibilities.
- chunksize default raised to 200.
- QwSpritePixmapSequence parameters are now pointers - they are passed to the
sprite. I'll probable make them QShared some day.
Version 1.41
- QwTextSprite fixed
- Example program re-compiled.
Version 1.42
- QwMobilePositionedSprite::forwardHits() and related functions,
allows you to more easily
see what a sprite would hit, without having to
actually move it.
- Some const-ness fixes.
Version 1.3
- Debugging facility - disable double buffering with QwSpriteField::doubleBuffer
- Bug fix: QwImageSpriteField parameters were used in reverse.
Version 1.2
- Full traversal of graphics available - QwSpriteField::all
- Robustness fixes
Version 1.1
- Resize implemented - QwSpriteField::resize
Classes
The basic concept is that a QwSpriteField has a collection
of QwSpriteFieldGraphic objects,
and each QwSpriteField can be viewed through
any number of QwSpriteFieldView widgets.
The most common QwSpriteFieldGraphic is the sprite
(which are usually QwSprite or QwRealSprite objects, but can be from
any derived class of QwVirtualSprite), which has a sequence of QwSpritePixmap
objects, usually collected into a QwSpritePixmapSequence. A QwSpritePixmap
is just an ordinary Qt QPixmap, extended with a hot-spot, mask, and collision
detection features.
Each sprite can
positioned somewhere on the QwSpriteField, and can be showing any
image from its sequence.
The class set is designed to be very extensible while maintaining
top performance. To this end, the hierarchy of different types of
graphics which may appear in a spritefield is large. However, the
main classes of interest are the QwSprite and QwRealSprite. The
hierarchy could also be extended
to include graphic elements other than
masked raster images, such as text and geometry shapes. The QwTextSprite
is a fairly simple extension (although some of its functionality should
perhaps be split into a QwRectangleGraphic).
Download the code
This is version 1.42. It is copyright © 1995-98 by
Warwick Allison.
The full package, including precompiled example program, is here for download:
QwSpriteField1.42.tar.gz.
Examples
See example.cpp in the package for an example program.