'\" t .TH TQCanvasPixmapArray 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. .\" .ad l .nh .SH NAME TQCanvasPixmapArray \- Array of TQCanvasPixmaps .SH SYNOPSIS \fC#include \fR .PP .SS "Public Members" .in +1c .ti -1c .BI "\fBTQCanvasPixmapArray\fR ()" .br .ti -1c .BI "\fBTQCanvasPixmapArray\fR ( const TQString & datafilenamepattern, int fc = 0 )" .br .ti -1c .BI "TQCanvasPixmapArray ( TQPtrList list, TQPtrList hotspots ) \fI(obsolete)\fR" .br .ti -1c .BI "\fBTQCanvasPixmapArray\fR ( TQValueList list, TQPointArray hotspots = TQPointArray ( ) )" .br .ti -1c .BI "\fB~TQCanvasPixmapArray\fR ()" .br .ti -1c .BI "bool \fBreadPixmaps\fR ( const TQString & filenamepattern, int fc = 0 )" .br .ti -1c .BI "bool \fBreadCollisionMasks\fR ( const TQString & filename )" .br .ti -1c .BI "bool operator! () \fI(obsolete)\fR" .br .ti -1c .BI "bool \fBisValid\fR () const" .br .ti -1c .BI "TQCanvasPixmap * \fBimage\fR ( int i ) const" .br .ti -1c .BI "void \fBsetImage\fR ( int i, TQCanvasPixmap * p )" .br .ti -1c .BI "uint \fBcount\fR () const" .br .in -1c .SH DESCRIPTION The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. .PP This class is used by TQCanvasSprite to hold an array of pixmaps. It is used to implement animated sprites, i.e. images that change over time, with each pixmap in the array holding one frame. .PP Depending on the constructor you use you can load multiple pixmaps into the array either from a directory (specifying a wildcard pattern for the files), or from a list of TQPixmaps. You can also read in a set of pixmaps after construction using readPixmaps(). .PP Individual pixmaps can be set with setImage() and retrieved with image(). The number of pixmaps in the array is returned by count(). .PP TQCanvasSprite uses an image's mask for collision detection. You can change this by reading in a separate set of image masks using readCollisionMasks(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQCanvasPixmapArray::TQCanvasPixmapArray ()" Constructs an invalid array (i.e. isValid() will return FALSE). You must call readPixmaps() before being able to use this TQCanvasPixmapArray. .SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 )" Constructs a TQCanvasPixmapArray from files. .PP The \fIfc\fR parameter sets the number of frames to be loaded for this image. .PP If \fIfc\fR is not 0, \fIdatafilenamepattern\fR should contain "%1", e.g. "foo%1.png". The actual filenames are formed by replacing the %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, foo0001.png, foo0002.png, etc. .PP If \fIfc\fR is 0, \fIdatafilenamepattern\fR is asssumed to be a filename, and the image contained in this file will be loaded as the first (and only) frame. .PP If \fIdatafilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, the array ends up empty and isValid() returns FALSE. .SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( TQPtrList list, TQPtrList hotspots )" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use TQCanvasPixmapArray::TQCanvasPixmapArray( TQValueList, TQPointArray ) instead. .PP Constructs a TQCanvasPixmapArray from the list of TQPixmaps \fIlist\fR. The \fIhotspots\fR list has to be of the same size as \fIlist\fR. .SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( TQValueList list, TQPointArray hotspots = TQPointArray ( ) )" Constructs a TQCanvasPixmapArray from the list of TQPixmaps in the \fIlist\fR. Each pixmap will get a hotspot according to the \fIhotspots\fR array. If no hotspots are specified, each one is set to be at position (0, 0). .PP If an error occurs, isValid() will return FALSE. .SH "TQCanvasPixmapArray::~TQCanvasPixmapArray ()" Destroys the pixmap array and all the pixmaps it contains. .SH "uint TQCanvasPixmapArray::count () const" Returns the number of pixmaps in the array. .SH "TQCanvasPixmap * TQCanvasPixmapArray::image ( int i ) const" Returns pixmap \fIi\fR in the array, if \fIi\fR is non-negative and less than than count(), and returns an unspecified value otherwise. .SH "bool TQCanvasPixmapArray::isValid () const" Returns TRUE if the pixmap array is valid; otherwise returns FALSE. .SH "bool TQCanvasPixmapArray::operator! ()" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isValid() instead. .PP This returns FALSE if the array is valid, and TRUE if it is not. .SH "bool TQCanvasPixmapArray::readCollisionMasks ( const TQString & filename )" Reads new collision masks for the array. .PP By default, TQCanvasSprite uses the image mask of a sprite to detect collisions. Use this function to set your own collision image masks. .PP If count() is 1 \fIfilename\fR must specify a real filename to read the mask from. If count() is greater than 1, the \fIfilename\fR must contain a "%1" that will get replaced by the number of the mask to be loaded, just like TQCanvasPixmapArray::readPixmaps(). .PP All collision masks must be 1-bit images or this function call will fail. .PP If the file isn't readable, contains the wrong number of images, or there is some other error, this function will return FALSE, and the array will be flagged as invalid; otherwise this function returns TRUE. .PP See also isValid(). .SH "bool TQCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 )" Reads one or more pixmaps into the pixmap array. .PP If \fIfc\fR is not 0, \fIfilenamepattern\fR should contain "%1", e.g." foo%1.png". The actual filenames are formed by replacing the %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, foo0001.png, foo0002.png, etc. .PP If \fIfc\fR is 0, \fIfilenamepattern\fR is asssumed to be a filename, and the image contained in this file will be loaded as the first (and only) frame. .PP If \fIfilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, this function will return FALSE, and isValid() will return FALSE; otherwise this function will return TRUE. .PP See also isValid(). .SH "void TQCanvasPixmapArray::setImage ( int i, TQCanvasPixmap * p )" Replaces the pixmap at index \fIi\fR with pixmap \fIp\fR. .PP The array takes ownership of \fIp\fR and will delete \fIp\fR when the array itself is deleted. .PP If \fIi\fR is beyond the end of the array the array is extended to at least i+1 elements, with elements count() to i-1 being initialized to 0. .SH "SEE ALSO" .BR http://doc.trolltech.com/tqcanvaspixmaparray.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. .SH AUTHOR Generated automatically from the source code. .SH BUGS If you find a bug in Qt, please report it as described in .BR http://doc.trolltech.com/bughowto.html . Good bug reports help us to help you. Thank you. .P The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. .P If you find errors in this manual page, please report them to .BR qt-bugs@trolltech.com . Please include the name of the manual page (tqcanvaspixmaparray.3qt) and the Qt version (3.3.8).