# QwSpritePixmap Class Reference

A QwSpritePixmap is a sprite frame image More...

`#include <QwSpriteField.h>`

Inherits QPixmap.

List of all member functions.

## Public Members

- QwSpritePixmap ( const char * datafilename, const char * maskfilename )
- QwSpritePixmap ( const QPixmap &, QPoint hotspot )
- ~QwSpritePixmap ()
- int hotX () const
- int hotY () const
- void setHotSpot ( int x, int y )

## Detailed Description

A QwSpritePixmap is a sprite frame image

Note that QwSpritePixmap should be considered an internal class at the current time. This will change (as will the interface) once alpha and description support for QImage is clarified.

See also: QwSpritePixmapSequence, QwVirtualSprite and QwSprite.

## Member Function Documentation

### QwSpritePixmap::QwSpritePixmap ( const QPixmap & pm, QPoint hotspot )

Construct a QwSpritePixmap from a QPixmap and a hotspot.

The QwSpritePixmap is a masked QPixmap used internally by sprite classes.

### QwSpritePixmap::QwSpritePixmap ( const char * dataname, const char * maskname )

Construct a QwSpritePixmap from two image files.

The QwSpritePixmap is a masked QPixmap used internally by sprite classes.

The dataname file must be a PPM file of the form:

    P6
    # HOTSPOT x y
    ...

That is, it must have an additional comment which gives the (x,y) coordinate of the `hotspot' of the image.

The `hotspot' position defines the origin pixel in the image For example, if the hotspot is (10,5), it will be displayed drawn 10 pixels to the left of and 5 pixels above the actual (x,y) coordinate of the sprite.

The maskname can be any monochrome image format, such as PBM. No special comments in the file are needed or recognized.

The maskname may also be 0, in which case the sprite has no mask (it is a solid rectangle). This will also be the case if the file maskname does not exist.

### QwSpritePixmap::~QwSpritePixmap ()

Deletes any collision mask.

### int QwSpritePixmap::hotX () const

Returns the X-position hotspot set for the pixmap.

### int QwSpritePixmap::hotY () const

Returns the Y-position hotspot set for the pixmap.

### void QwSpritePixmap::setHotSpot ( int x, int y )

Sets the hotspot to (x, y).

The hotspot position defines the origin pixel in the image For example, if the hotspot is (10,5), it will be displayed drawn 10 pixels to the left of and 5 pixels above the actual (x,y) coordinate of the sprite.

This file is copyright © 1995-97 Warwick Allison.

It was generated from the following files:

- QwSpriteField.h
- QwSpriteField-double.cpp
- QwSpriteField-int.cpp
- QwSpriteField-mobdouble.cpp
- QwSpriteField-mobint.cpp
- QwSpriteField-template.cpp
- QwSpriteField.cpp