Q3CanvasSprite Class Reference |
Constant | Value | Description |
---|---|---|
Q3CanvasSprite::Cycle | 0 | at each advance the frame number will be incremented by 1 (modulo the frame count). |
Q3CanvasSprite::Oscillate | 1 | 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. |
Constructs a Q3CanvasSprite which uses images from the Q3CanvasPixmapArray a.
The sprite in initially positioned at (0, 0) on canvas, using frame 0.
Destroys the sprite and removes it from the canvas. Does not delete the images.
Extends the default Q3CanvasItem implementation to provide the functionality of setFrameAnimation().
The phase is 0 or 1: see Q3CanvasItem::advance() for details.
Reimplemented from Q3CanvasItem.
See also Q3CanvasItem::advance() and setVelocity().
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.)
See also leftEdge(), rightEdge(), and topEdge().
This is an overloaded member function, provided for convenience.
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 ny.
See also leftEdge(), rightEdge(), and topEdge().
Returns the bounding rectangle for the image in the sprite's current frame. This assumes that the images are tightly cropped (i.e. do not have transparent pixels all along a side).
Reimplemented from Q3CanvasItem.
Draws the current frame's image at the sprite's current position on painter painter.
Reimplemented from Q3CanvasItem.
Returns the index of the current animation frame in the Q3CanvasSprite's Q3CanvasPixmapArray.
See also setFrame() and move().
Returns the number of frames in the Q3CanvasSprite's Q3CanvasPixmapArray.
The height of the sprite for the current frame's image.
See also frame().
Returns the current frame's image.
See also frame() and setFrame().
This is an overloaded member function, provided for convenience.
Returns the image for frame f. Does not do any bounds checking on f.
Returns the image the sprite will have after advance(1) is called. By default this is the same as image().
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.)
See also rightEdge(), bottomEdge(), and topEdge().
This is an overloaded member function, provided for convenience.
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 nx.
See also rightEdge(), bottomEdge(), and topEdge().
Moves the sprite to (x, y).
This is an overloaded member function, provided for convenience.
Moves the sprite to (nx, ny) and sets the current frame to nf. nf will be ignored if it is larger than frameCount() or smaller than 0.
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.)
See also leftEdge(), bottomEdge(), and topEdge().
This is an overloaded member function, provided for convenience.
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 nx.
See also leftEdge(), bottomEdge(), and topEdge().
Returns 1 (Q3CanvasItem::Rtti_Sprite).
Reimplemented from Q3CanvasItem.
See also Q3CanvasItem::rtti().
Sets the animation frame used for displaying the sprite to f, an index into the Q3CanvasSprite's Q3CanvasPixmapArray. The call will be ignored if f is larger than frameCount() or smaller than 0.
Sets the animation characteristics for the sprite.
For type == Cycle, the frames will increase by step at each advance, modulo the frameCount().
For type == Oscillate, the frames will increase by step at each advance, up to the frameCount(), then decrease by step back to 0, repeating forever.
The state parameter is for internal use.
Set the array of images used for displaying the sprite to the Q3CanvasPixmapArray a.
If the current frame() is larger than the number of images in a, the current frame will be reset to 0.
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.)
See also leftEdge(), rightEdge(), and bottomEdge().
This is an overloaded member function, provided for convenience.
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 ny.
See also leftEdge(), rightEdge(), and bottomEdge().
The width of the sprite for the current frame's image.
See also frame().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.1 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com