Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3315

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- q3canvas.cpp -->
<head>
  <title>Qt 4.6: Q3CanvasSprite Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//Q3CanvasSprite"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Q3CanvasSprite Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
</h1>
<p>The Q3CanvasSprite class provides an animated canvas item on a <a href="q3canvas.html">Q3Canvas</a>. <a href="#details">More...</a></p>
<pre> #include &lt;Q3CanvasSprite&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p>
<p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<p>Inherits <a href="q3canvasitem.html">Q3CanvasItem</a>.</p>
<ul>
<li><a href="q3canvassprite-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#FrameAnimationType-enum">FrameAnimationType</a></b> { Cycle, Oscillate }</td></tr>
</table>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#Q3CanvasSprite">Q3CanvasSprite</a></b> ( Q3CanvasPixmapArray * <i>a</i>, Q3Canvas * <i>canvas</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#dtor.Q3CanvasSprite">~Q3CanvasSprite</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#bottomEdge">bottomEdge</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#bottomEdge-2">bottomEdge</a></b> ( int <i>ny</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#frame">frame</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#frameCount">frameCount</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Q3CanvasPixmap * </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#image">image</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Q3CanvasPixmap * </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#image-2">image</a></b> ( int <i>f</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual Q3CanvasPixmap * </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#imageAdvanced">imageAdvanced</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#leftEdge">leftEdge</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#leftEdge-2">leftEdge</a></b> ( int <i>nx</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#move">move</a></b> ( double <i>x</i>, double <i>y</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#move-2">move</a></b> ( double <i>nx</i>, double <i>ny</i>, int <i>nf</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#rightEdge">rightEdge</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#rightEdge-2">rightEdge</a></b> ( int <i>nx</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#setFrame">setFrame</a></b> ( int <i>f</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#setFrameAnimation">setFrameAnimation</a></b> ( FrameAnimationType <i>type</i> = Cycle, int <i>step</i> = 1, int <i>state</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#setSequence">setSequence</a></b> ( Q3CanvasPixmapArray * <i>a</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#topEdge">topEdge</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#topEdge-2">topEdge</a></b> ( int <i>ny</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#width">width</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#advance">advance</a></b> ( int <i>phase</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QRect </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#collidesWith">collidesWith</a></b> ( const Q3CanvasItem * <i>i</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#draw">draw</a></b> ( QPainter &amp; <i>painter</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="q3canvassprite.html#rtti">rtti</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>34 public functions inherited from <a href="q3canvasitem.html#public-functions">Q3CanvasItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 protected function inherited from <a href="q3canvasitem.html#protected-functions">Q3CanvasItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3CanvasSprite class provides an animated canvas item on a <a href="q3canvas.html">Q3Canvas</a>.</p>
<p>A canvas sprite is an object which can contain any number of images (referred to as frames), only one of which is current, i.e&#x2e; displayed, at any one time. The images can be passed in the constructor or set or changed later with <a href="q3canvassprite.html#setSequence">setSequence</a>(). If you subclass Q3CanvasSprite you can change the frame that is displayed periodically, e.g&#x2e; whenever Q3CanvasItem::advance(1) is called to create the effect of animation.</p>
<p>The current frame can be set with <a href="q3canvassprite.html#setFrame">setFrame</a>() or with <a href="q3canvassprite.html#move">move</a>(). The number of frames available is given by <a href="q3canvassprite.html#frameCount">frameCount</a>(). The bounding rectangle of the current frame is returned by <a href="q3canvassprite.html#boundingRect">boundingRect</a>().</p>
<p>The current frame's image can be retrieved with <a href="q3canvassprite.html#image">image</a>(); use <a href="q3canvassprite.html#imageAdvanced">imageAdvanced</a>() to retrieve the image for the frame that will be shown after advance(1) is called. Use the <a href="q3canvassprite.html#image">image</a>() overload passing it an integer index to retrieve a particular image from the list of frames.</p>
<p>Use <a href="q3canvassprite.html#width">width</a>() and <a href="q3canvassprite.html#height">height</a>() to retrieve the dimensions of the current frame.</p>
<p>Use <a href="q3canvassprite.html#leftEdge">leftEdge</a>() and <a href="q3canvassprite.html#rightEdge">rightEdge</a>() to retrieve the current frame's left-hand and right-hand x-coordinates respectively. Use <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>() and <a href="q3canvassprite.html#topEdge">topEdge</a>() to retrieve the current frame's bottom and top y-coordinates respectively. These functions have an overload which will accept an integer frame number to retrieve the coordinates of a particular frame.</p>
<p>Q3CanvasSprite draws very quickly, at the expense of memory.</p>
<p>The current frame's image can be drawn on a painter with <a href="q3canvassprite.html#draw">draw</a>().</p>
<p>Like any other canvas item, canvas sprites can be moved with <a href="q3canvassprite.html#move">move</a>() which sets the x and y coordinates and the frame number, as well as with <a href="q3canvasitem.html#move">Q3CanvasItem::move</a>() and <a href="q3canvasitem.html#moveBy">Q3CanvasItem::moveBy</a>(), or by setting coordinates with <a href="q3canvasitem.html#setX">Q3CanvasItem::setX</a>(), <a href="q3canvasitem.html#setY">Q3CanvasItem::setY</a>() and <a href="q3canvasitem.html#setZ">Q3CanvasItem::setZ</a>().</p>
<p>See also <a href="http://qt.nokia.com/doc/qtcanvas">QtCanvas</a> and <a href="graphicsview-porting.html">Porting to Graphics View</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<a name="//apple_ref/cpp/tag/Q3CanvasSprite/FrameAnimationType"></a>
<a name="//apple_ref/cpp/econst/Q3CanvasSprite/Cycle"></a>
<a name="//apple_ref/cpp/econst/Q3CanvasSprite/Oscillate"></a>
<h3 class="fn"><a name="FrameAnimationType-enum"></a>enum Q3CanvasSprite::FrameAnimationType</h3>
<p>This enum is used to identify the different types of frame animation offered by <a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a>.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>Q3CanvasSprite::Cycle</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">at each advance the frame number will be incremented by 1 (modulo the frame count).</td></tr>
<tr><td valign="top"><tt>Q3CanvasSprite::Oscillate</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">at each advance the frame number will be incremented by 1 up to the frame count then decremented to by 1 to 0, repeating this sequence forever.</td></tr>
</table></p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/Q3CanvasSprite"></a>
<h3 class="fn"><a name="Q3CanvasSprite"></a>Q3CanvasSprite::Q3CanvasSprite ( <a href="q3canvaspixmaparray.html">Q3CanvasPixmapArray</a> * <i>a</i>, <a href="q3canvas.html">Q3Canvas</a> * <i>canvas</i> )</h3>
<p>Constructs a <a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a> which uses images from the <a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a> <i>a</i>.</p>
<p>The sprite in initially positioned at (0, 0) on <i>canvas</i>, using frame 0.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/~Q3CanvasSprite"></a>
<h3 class="fn"><a name="dtor.Q3CanvasSprite"></a>Q3CanvasSprite::~Q3CanvasSprite ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the sprite and removes it from the canvas. Does <i>not</i> delete the images.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/advance"></a>
<h3 class="fn"><a name="advance"></a>void Q3CanvasSprite::advance ( int <i>phase</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3canvasitem.html#advance">Q3CanvasItem::advance</a>().</p>
<p>Extends the default <a href="q3canvasitem.html" class="compat">Q3CanvasItem</a> implementation to provide the functionality of <a href="q3canvassprite.html#setFrameAnimation">setFrameAnimation</a>().</p>
<p>The <i>phase</i> is 0 or 1: see <a href="q3canvasitem.html#advance">Q3CanvasItem::advance</a>() for details.</p>
<p>See also <a href="q3canvasitem.html#advance">Q3CanvasItem::advance</a>() and <a href="q3canvasitem.html#setVelocity">setVelocity</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/bottomEdge"></a>
<h3 class="fn"><a name="bottomEdge"></a>int Q3CanvasSprite::bottomEdge () const</h3>
<p>Returns the y-coordinate of the current bottom edge of the sprite. (This may change as the sprite animates since different frames may have different bottom edges.)</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<h3 class="fn"><a name="bottomEdge-2"></a>int Q3CanvasSprite::bottomEdge ( int <i>ny</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position <i>ny</i>.</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/boundingRect"></a>
<h3 class="fn"><a name="boundingRect"></a><a href="qrect.html">QRect</a> Q3CanvasSprite::boundingRect () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3canvasitem.html#boundingRect">Q3CanvasItem::boundingRect</a>().</p>
<p>Returns the bounding rectangle for the image in the sprite's current frame. This assumes that the images are tightly cropped (i.e&#x2e; do not have transparent pixels all along a side).</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/collidesWith"></a>
<h3 class="fn"><a name="collidesWith"></a>bool Q3CanvasSprite::collidesWith ( const <a href="q3canvasitem.html">Q3CanvasItem</a> * <i>i</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3canvasitem.html#collidesWith">Q3CanvasItem::collidesWith</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/draw"></a>
<h3 class="fn"><a name="draw"></a>void Q3CanvasSprite::draw ( <a href="qpainter.html">QPainter</a> &amp; <i>painter</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3canvasitem.html#draw">Q3CanvasItem::draw</a>().</p>
<p>Draws the current frame's image at the sprite's current position on painter <i>painter</i>.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/frame"></a>
<h3 class="fn"><a name="frame"></a>int Q3CanvasSprite::frame () const</h3>
<p>Returns the index of the current animation frame in the <a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a>'s <a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a>.</p>
<p>See also <a href="q3canvassprite.html#setFrame">setFrame</a>() and <a href="q3canvassprite.html#move">move</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/frameCount"></a>
<h3 class="fn"><a name="frameCount"></a>int Q3CanvasSprite::frameCount () const</h3>
<p>Returns the number of frames in the <a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a>'s <a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a>.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/height"></a>
<h3 class="fn"><a name="height"></a>int Q3CanvasSprite::height () const</h3>
<p>The height of the sprite for the current frame's image.</p>
<p>See also <a href="q3canvassprite.html#frame">frame</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/image"></a>
<h3 class="fn"><a name="image"></a><a href="q3canvaspixmap.html">Q3CanvasPixmap</a> * Q3CanvasSprite::image () const</h3>
<p>Returns the current frame's image.</p>
<p>See also <a href="q3canvassprite.html#frame">frame</a>() and <a href="q3canvassprite.html#setFrame">setFrame</a>().</p>
<h3 class="fn"><a name="image-2"></a><a href="q3canvaspixmap.html">Q3CanvasPixmap</a> * Q3CanvasSprite::image ( int <i>f</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the image for frame <i>f</i>. Does not do any bounds checking on <i>f</i>.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/imageAdvanced"></a>
<h3 class="fn"><a name="imageAdvanced"></a><a href="q3canvaspixmap.html">Q3CanvasPixmap</a> * Q3CanvasSprite::imageAdvanced () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the image the sprite <i>will</i> have after advance(1) is called. By default this is the same as <a href="q3canvassprite.html#image">image</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/leftEdge"></a>
<h3 class="fn"><a name="leftEdge"></a>int Q3CanvasSprite::leftEdge () const</h3>
<p>Returns the x-coordinate of the current left edge of the sprite. (This may change as the sprite animates since different frames may have different left edges.)</p>
<p>See also <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<h3 class="fn"><a name="leftEdge-2"></a>int Q3CanvasSprite::leftEdge ( int <i>nx</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns what the x-coordinate of the left edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position <i>nx</i>.</p>
<p>See also <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/move"></a>
<h3 class="fn"><a name="move"></a>void Q3CanvasSprite::move ( double <i>x</i>, double <i>y</i> )</h3>
<p>Moves the sprite to (<i>x</i>, <i>y</i>).</p>
<h3 class="fn"><a name="move-2"></a>void Q3CanvasSprite::move ( double <i>nx</i>, double <i>ny</i>, int <i>nf</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Moves the sprite to (<i>nx</i>, <i>ny</i>) and sets the current frame to <i>nf</i>. <i>nf</i> will be ignored if it is larger than <a href="q3canvassprite.html#frameCount">frameCount</a>() or smaller than 0.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/rightEdge"></a>
<h3 class="fn"><a name="rightEdge"></a>int Q3CanvasSprite::rightEdge () const</h3>
<p>Returns the x-coordinate of the current right edge of the sprite. (This may change as the sprite animates since different frames may have different right edges.)</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<h3 class="fn"><a name="rightEdge-2"></a>int Q3CanvasSprite::rightEdge ( int <i>nx</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns what the x-coordinate of the right edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position <i>nx</i>.</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>(), and <a href="q3canvassprite.html#topEdge">topEdge</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/rtti"></a>
<h3 class="fn"><a name="rtti"></a>int Q3CanvasSprite::rtti () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3canvasitem.html#rtti">Q3CanvasItem::rtti</a>().</p>
<p>Returns 1 (<a href="q3canvasitem.html#RttiValues-enum">Q3CanvasItem::Rtti_Sprite</a>).</p>
<p>See also <a href="q3canvasitem.html#rtti">Q3CanvasItem::rtti</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/setFrame"></a>
<h3 class="fn"><a name="setFrame"></a>void Q3CanvasSprite::setFrame ( int <i>f</i> )</h3>
<p>Sets the animation frame used for displaying the sprite to <i>f</i>, an index into the <a href="q3canvassprite.html" class="compat">Q3CanvasSprite</a>'s <a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a>. The call will be ignored if <i>f</i> is larger than <a href="q3canvassprite.html#frameCount">frameCount</a>() or smaller than 0.</p>
<p>See also <a href="q3canvassprite.html#frame">frame</a>() and <a href="q3canvassprite.html#move">move</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/setFrameAnimation"></a>
<h3 class="fn"><a name="setFrameAnimation"></a>void Q3CanvasSprite::setFrameAnimation ( <a href="q3canvassprite.html#FrameAnimationType-enum">FrameAnimationType</a> <i>type</i> = Cycle, int <i>step</i> = 1, int <i>state</i> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the animation characteristics for the sprite.</p>
<p>For <i>type</i> == <tt>Cycle</tt>, the frames will increase by <i>step</i> at each advance, modulo the <a href="q3canvassprite.html#frameCount">frameCount</a>().</p>
<p>For <i>type</i> == <tt>Oscillate</tt>, the frames will increase by <i>step</i> at each advance, up to the <a href="q3canvassprite.html#frameCount">frameCount</a>(), then decrease by <i>step</i> back to 0, repeating forever.</p>
<p>The <i>state</i> parameter is for internal use.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/setSequence"></a>
<h3 class="fn"><a name="setSequence"></a>void Q3CanvasSprite::setSequence ( <a href="q3canvaspixmaparray.html">Q3CanvasPixmapArray</a> * <i>a</i> )</h3>
<p>Set the array of images used for displaying the sprite to the <a href="q3canvaspixmaparray.html" class="compat">Q3CanvasPixmapArray</a> <i>a</i>.</p>
<p>If the current <a href="q3canvassprite.html#frame">frame</a>() is larger than the number of images in <i>a</i>, the current frame will be reset to 0.</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/topEdge"></a>
<h3 class="fn"><a name="topEdge"></a>int Q3CanvasSprite::topEdge () const</h3>
<p>Returns the y-coordinate of the top edge of the sprite. (This may change as the sprite animates since different frames may have different top edges.)</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), and <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>().</p>
<h3 class="fn"><a name="topEdge-2"></a>int Q3CanvasSprite::topEdge ( int <i>ny</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position <i>ny</i>.</p>
<p>See also <a href="q3canvassprite.html#leftEdge">leftEdge</a>(), <a href="q3canvassprite.html#rightEdge">rightEdge</a>(), and <a href="q3canvassprite.html#bottomEdge">bottomEdge</a>().</p>
<a name="//apple_ref/cpp/instm/Q3CanvasSprite/width"></a>
<h3 class="fn"><a name="width"></a>int Q3CanvasSprite::width () const</h3>
<p>The width of the sprite for the current frame's image.</p>
<p>See also <a href="q3canvassprite.html#frame">frame</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>