A QwSpriteFieldGraphic which renders as a masked image. More...
#include <QwSpriteField.h>
Inherits QwSpriteFieldGraphic.
Inherited by QwPositionedSprite.
QwVirtualSprites are most of the implementation of sprites, except they do not define the x(), y(), z() and image() methods. This allows for user-defined coordinates systems and animation methods.
See also: QwSprite.
Construct a QwVirtualSprite. Derived classes should call addToChunks() in their constructor once x(), y(), and image() are valid.
[virtual]
Destruct the QwVirtualSprite. Derived classes must remove the sprite from any chunks, as this destructor cannot call the virtual methods required to do so.
[protected]
The left edge, in collision-detection coordinates.
See also: QwVirtualSprite::setPixelCollisionPrecision(int).
[protected]
The right edge, in collision-detection coordinates.
See also: QwVirtualSprite::setPixelCollisionPrecision(int).
[protected]
The top edge, in collision-detection coordinates.
See also: QwVirtualSprite::setPixelCollisionPrecision(int).
[protected]
The bottom edge, in collision-detection coordinates.
See also: QwVirtualSprite::setPixelCollisionPrecision(int).
[protected]
The absolute horizontal position of the QwVirtualSprite. This is the pixel position of the left edge of the image, as it takes into account the hotspot.
[protected]
The absolute horizontal position of the QwVirtualSprite, if it was moved to nx.
[protected]
The right edge of the sprite image.
See also: absX().
[protected]
The right edge of the sprite image, if it was moved to nx.
See also: absX().
[protected]
The absolute vertical position of the QwVirtualSprite. This is the pixel position of the top edge of the image, as it takes into account the hotspot.
[protected]
The absolute vertical position of the QwVirtualSprite, if it was moved to ny.
[protected]
The bottom edge of the sprite image.
See also: absY().
[protected]
The bottom edge of the sprite image, if it was moved to ny.
See also: absY().
[protected]
Add the sprite to the chunks in its QwSpriteField which it overlaps.
This must be called as the values of x(), y(), and image() change such that the QwVirtualSprite is removed from chunks it is in, the values of x(), y(), and image() change, then it is added back into the then covered chunks in the QwSpriteField.
The QwPositionedSprite and derived classes deals with this automatically, as must other derived classes of QwVirtualSprite.
Returns the QwSpriteFieldGraphic at the given traversal point.
See also: neighbourhood(int,int,QwSpritePixmap*).
[virtual]
Used by the methods associated with QwSpriteField::topAt(int x, int y) to test for an exact hit.
See also: neighbourhood(int,int,QwSpritePixmap*).
[virtual]
Used by the methods associated with QwSpriteField::topAt(int x, int y) to test for a close hit.
See also: neighbourhood(int,int,QwSpritePixmap*).
[virtual]
(override)
Tests if the given pixel touches the sprite. This uses pixel-accurate detection, using the collision mask of the sprites current image (which is by default the image mask). This test is useful for example to test when the user clicks a point with they mouse. Note however, that QwSpriteField::topAt(int x, int y) and associated methods give a more efficient and flexible technique for this purpose.
The height of the sprite in collision-detection coordinates.
The width of the sprite in collision-detection coordinates.
[static]
Convert a coordinate from collision to world coordinates.
See also: setPixelCollisionPrecision(int) and QwSpriteField::setPositionPrecision.
[virtual protected]
(override)
Draws the current image of the sprite at its current position, as given by image() and x(), y().
Terminate a traversal early.
See also: neighbourhood(int,int,QwSpritePixmap*) and QwSpriteField::end(Pix&).
See also: neighbourhood(int,int,QwSpritePixmap*) and const.
The height of the sprite, in its current image.
Test if this sprite is touching the given QwSpriteFieldGraphic. This is a convenient packaging of neighbourhood() and related methods.
[virtual]
This abstract method should return the pixmap to be drawn for the sprite.
[virtual protected]
Adds/removes the sprite from the QwSpriteField chunks it covers, as required by QwSpriteFieldGraphic. This, addToChunks, and the removeFromChunks method may be moved up to QwSpriteFieldGraphic. Either way, this or the other two would have to be virtual.
Creates an iterator which traverses the QwSpriteFieldGraphic objects which collide with this sprite at its current position.
See also: neighbourhood(int,int,QwSpritePixmap*).
Creates an iterator which traverses the QwSpriteFieldGraphic objects which would collide with this sprite if it was moved to the given position (yet kept its current image).
See also: neighbourhood(int,int,QwSpritePixmap*).
Creates an iterator which can traverse the area which the QwVirtualSprite would cover if it had the given position and image. This `would cover' concept is useful as it allows you to check for a collision before moving the sprite.
Traverse to the next QwSpriteFieldGraphic in a collision list.
See also: neighbourhood(int,int,QwSpritePixmap*).
[protected]
Remove the sprite from the chunks in its QwSpriteField which it overlaps.
See also: addToChunks().
[virtual]
Returns 1.
See also: QwSpriteFieldGraphic::rtti().
[static]
Using this method, the resolution of the collision mask can be different to the resolution of the pixel coordinates of the sprites. One possible use for this is to have differently scaled graphics being used by different players in a multiplayer distributed game, yet for the collision detection to be identical for each player.
See also: QwSpritePixmapSequence::readCollisionMasks(...).
The width of the sprite, in its current image.
[static]
Convert a coordinate from world to collision coordinates.
See also: setPixelCollisionPrecision(int) and QwSpriteField::setPositionPrecision.
Test if this sprite would (exactly) touch the given QwSpriteFieldGraphic. This is a convenient packaging of neighbourhood() and related methods.
[virtual]
This abstract method should return the horizontal location, measured from the left edge of the QwSpriteField, at which to draw the pixmap of the sprite. Note that the hotspot of the pixmap will be taken into account.
[virtual]
This abstract method should return the vertical location, measured from the top edge of the QwSpriteField, at which to draw the pixmap of the sprite. Note that the hotspot of the pixmap will be taken into account.
This file is copyright © 1995-97 Warwick Allison.
It was generated from the following files: