📄 qcanvassprite.3qt
字号:
'\" t.TH QCanvasSprite 3qt "5 August 2004" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQCanvasSprite \- Animated moving pixmap on a.br.PP\fC#include <qcanvas.h>\fR.PPInherits QCanvasItem..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCanvasSprite\fR ( QCanvasPixmapArray * " "array" ", QCanvas * canvas ) ".br.ti -1c.BI "void \fBsetSequence\fR ( QCanvasPixmapArray * seq ) ".br.ti -1c.BI "virtual \fB~QCanvasSprite\fR () ".br.ti -1c.BI "virtual void \fBmove\fR ( double " "x" ", double " "y" ", int frame ) ".br.ti -1c.BI "void \fBsetFrame\fR ( int ) ".br.ti -1c.BI "int \fBframe\fR () const".br.ti -1c.BI "int \fBframeCount\fR () const".br.ti -1c.BI "virtual int \fBrtti\fR () const".br.ti -1c.BI "virtual QRect \fBboundingRect\fR () const".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBdraw\fR ( QPainter & painter ) ".br.ti -1c.BI "int \fBwidth\fR () const".br.ti -1c.BI "int \fBheight\fR () const".br.ti -1c.BI "int \fBabsX\fR () const".br.ti -1c.BI "int \fBabsY\fR () const".br.ti -1c.BI "int \fBabsX2\fR () const".br.ti -1c.BI "int \fBabsY2\fR () const".br.ti -1c.BI "int \fBabsX\fR ( int nx ) const".br.ti -1c.BI "int \fBabsY\fR ( int ny ) const".br.ti -1c.BI "int \fBabsX2\fR ( int nx ) const".br.ti -1c.BI "int \fBabsY2\fR ( int ny ) const".br.ti -1c.BI "QCanvasPixmap* \fBimage\fR () const".br.ti -1c.BI "virtual QCanvasPixmap* \fBimageAdvanced\fR () const".br.ti -1c.BI "QCanvasPixmap* \fBimage\fR ( int f ) const".br.in -1c.SH DESCRIPTIONThe QCanvasSprite class provides an animated moving pixmap on a QCanvas..PPA "sprite" is an image object that moves around independently of foreground and background. On a QCanvas, everything moves around independently of the foreground and background, so a QCanvasSprite is just a image whose API makes it simpler to use animation and a hot spot..PPQCanvasSprite draws very fast, at the cost of some memory..SH MEMBER FUNCTION DOCUMENTATION.SH "QCanvasSprite::QCanvasSprite ( QCanvasPixmapArray * a, QCanvas * canvas )"Constructs a QCanvasSprite which uses images from the given array..PPThe sprite in initially at (0,0) on \fIcanvas,\fR using frame 0..SH "QCanvasSprite::~QCanvasSprite () \fC[virtual]\fR"Destruct the sprite. It is removed from its QCanvas in this process..SH "int QCanvasSprite::absX () const \fC[protected]\fR"The absolute horizontal position of the sprite. This is the pixel position of the left edge of the image, as it takes into account the offset..SH "int QCanvasSprite::absX ( int nx ) const \fC[protected]\fR"The absolute horizontal position of the sprite, if it was moved to \fInx.\fR.SH "int QCanvasSprite::absX2 () const \fC[protected]\fR"The right edge of the sprite image..PPSee also absX()..SH "int QCanvasSprite::absX2 ( int nx ) const \fC[protected]\fR"The right edge of the sprite image, if the sprite was moved to \fInx.\fR.PPSee also absX()..SH "int QCanvasSprite::absY () const \fC[protected]\fR"The absolute vertical position of the sprite. This is the pixel position of the top edge of the image, as it takes into account the offset..SH "int QCanvasSprite::absY ( int ny ) const \fC[protected]\fR"The absolute vertical position of the sprite, if it was moved to \fIny.\fR.SH "int QCanvasSprite::absY2 () const \fC[protected]\fR"The bottom edge of the sprite image..PPSee also absY()..SH "int QCanvasSprite::absY2 ( int ny ) const \fC[protected]\fR"The bottom edge of the sprite image, \fIif\fR the sprite was moved to \fIny.\fR.PPSee also absY()..SH "QRect QCanvasSprite::boundingRect () const \fC[virtual]\fR"Returns the bounding rectangle of pixels covered by the sprite. This assumes that the images are tightly cropped (ie. do not have transparent pixels all along a side)..PPReimplemented from QCanvasItem..SH "bool QCanvasSprite::collidesWith ( const QCanvasItem * i ) const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QCanvasItem..SH "void QCanvasSprite::draw ( QPainter & painter ) \fC[virtual protected]\fR"Draws the current image of the sprite at its current position, as given by image() and x(), y()..PPReimplemented from QCanvasItem..SH "int QCanvasSprite::frame () const"Returns the index into the QCanvasSprite's QCanvasPixmapArray of the current animation frame..PPSee also setFrame() and move(double,double,int)..SH "int QCanvasSprite::frameCount () const"Returns the number of frames in the QCanvasSprite's QCanvasPixmapArray..SH "int QCanvasSprite::height () const \fC[protected]\fR"The height of the sprite, in its current image..PPSee also frame()..SH "QCanvasPixmap* QCanvasSprite::image () const \fC[protected]\fR"Returns the current image frame..PPSee also frame() and setFrame()..SH "QCanvasPixmap* QCanvasSprite::image ( int f ) const \fC[protected]\fR"Returns image frame \fIf.\fR.SH "QCanvasPixmap* QCanvasSprite::imageAdvanced () const \fC[virtual protected]\fR"The image the sprite \fIwill\fR have after advance(1) is called. Be default this is the same as image()..SH "void QCanvasSprite::move ( double nx, double ny, int nf ) \fC[virtual]\fR"Set both the position and the frame of the sprite..SH "void QCanvasSprite::move ( double x, double y )"Reimplemented for internal reasons; the API is not affected..SH "int QCanvasSprite::rtti () const \fC[virtual]\fR"Returns 1..SH "void QCanvasSprite::setFrame ( int f )"Sets the animation frame used for displaying the sprite to \fIf,\fR an index into the QCanvasSprite's QCanvasPixmapArray..PPSee also frame() and move(double,double,int)..SH "void QCanvasSprite::setSequence ( QCanvasPixmapArray * a )"Set the array of images used for displaying the sprite. Note that the array should have enough images for the sprites current frame() to be valid..SH "int QCanvasSprite::width () const \fC[protected]\fR"The width of the sprite, in its current image..PPSee also frame()..SH "SEE ALSO".BR http://doc.trolltech.com/qcanvassprite.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qcanvassprite.3qt) and the Qtversion (2.3.8).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -