QCanvasPixmapArray(3qt)

NAME
QCanvasPixmapArray - An array of

#include <qcanvas.h>

  Public Members
QCanvasPixmapArray ()
QCanvasPixmapArray ( const QString & datafilenamepattern, int framecount=0 )
QCanvasPixmapArray ( QList<QPixmap>, QList<QPoint> hotspots )
~QCanvasPixmapArray ()
bool readPixmaps ( const QString & datafilenamepattern, int framecount=0 )
bool readCollisionMasks ( const QString & filenamepattern )
int operator! ()
QCanvasPixmap* image ( int i ) const
void setImage ( int i, QCanvasPixmap * p )
uint count () const

DESCRIPTION
An array of QCanvasPixmap to have multiple frames for animation.

This allows sprite objects to have multiple frames for animation.

QCanvasPixmaps for sprite objects are collected into QCanvasPixmapArrays, which are the set of images a sprite will use, indexed by the sprite's frame. This allows sprites to simply have animated forms.

MEMBER FUNCTION DOCUMENTATION

QCanvasPixmapArray::QCanvasPixmapArray ()
Constructs a null array. You should call readPixmaps() before using it further.

QCanvasPixmapArray::QCanvasPixmapArray ( QList<QPixmap> list, QList<QPoint> hotspots )
Constructs a QCanvasPixmapArray from QPixmaps.

QCanvasPixmapArray::QCanvasPixmapArray ( const QString & datafilenamepattern, int fc=0 )
Constructs a QCanvasPixmapArray from files. See readPixmaps() for details.

QCanvasPixmapArray::~QCanvasPixmapArray ()
Destructs the pixmap array.

uint QCanvasPixmapArray::count () const
Returns the length of the array.

QCanvasPixmap* QCanvasPixmapArray::image ( int i ) const
Returns the i-th pixmap in the array.

int QCanvasPixmapArray::operator! ()
Constructor failure check.

bool QCanvasPixmapArray::readCollisionMasks ( const QString & fname )
When testing sprite collision detection the default is to use the image mask of the sprite. By using readCollisionMasks(), an alternate mask can be used. The images must be 1-bit deep.

bool QCanvasPixmapArray::readPixmaps ( const QString & datafilenamepattern, int fc=0 )
Sets the array to fc pixmaps, read from files.

If fc is not 0, the filenames should contain a "%1", strings such as "foo%1.png". The actual filenames are formed by replacing the %1 with each integer from 0 to fc-1, with leading zeroes sufficient for 4 digits. eg. foo0000.png, foo0001.png, foo0002.png, etc.

void QCanvasPixmapArray::setImage ( int i, QCanvasPixmap * p )
Replaces the i-th pixmap by p. Note that p becomes owned by the array - it will be deleted later.

If i is more than count()-1, the array is extended to make room.

SEE ALSO
http://doc.trolltech.com/qcanvaspixmaparray.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcanvaspixmaparray.3qt) and the Qt version (2.3.7).