QwTextSprite Class Reference


A text object on a QwSpriteField. More...

#include <QwSpriteField.h>

Inherits QwSpriteFieldGraphic.

List of all member functions.

Public Members

Protected Members


Detailed Description

A text object on a QwSpriteField.

A QwTextSprite has text, a font, color, and position.


Member Function Documentation

QwTextSprite::QwTextSprite ()

Construct a QwTextSprite with the text "".

QwTextSprite::QwTextSprite ( const char * t )

Construct a QwTextSprite with the text t.

The text should not contain newlines.

QwTextSprite::QwTextSprite ( const char * t, QFont f )

Construct a QwTextSprite with the text t and font f.

The text should not contain newlines.

QwTextSprite::~QwTextSprite () [virtual]

Destruct the sprite.

void QwTextSprite::addToChunks () [protected]

Adds the sprite to the appropriate chunks.

bool QwTextSprite::at ( const class QRect & r ) const

For collision detection.

bool QwTextSprite::at ( int x, int y ) const [virtual]

For collision detection.

Reimplemented from QwSpriteFieldGraphic.

const QRect& QwTextSprite::boundingRect ()

Returns the bounding rectangle of the text.

void QwTextSprite::draw ( QPainter & painter ) [virtual protected]

Draws the text.

void QwTextSprite::makeVisible ( bool yes ) [virtual protected]

Toggles visibility.

void QwTextSprite::moveBy ( int dx, int dy )

Moves text by the given displacements.

void QwTextSprite::moveTo ( int x, int y )

Sets the position of the bottom-left corner of the text.

void QwTextSprite::removeFromChunks () [protected]

Removes the sprite to the appropriate chunks.

int QwTextSprite::rtti () const [virtual]

Returns 3.

See also: QwSpriteFieldGraphic::rtti().

void QwTextSprite::setColor ( const QColor & c )

Sets the color of the text.

void QwTextSprite::setFont ( const QFont & f )

Sets the font in which the text is drawn.

void QwTextSprite::setText ( const char * t )

Sets the text to be displayed. The text may contain newlines.

void QwTextSprite::setTextFlags ( int f )

Sets the alignment flags. These are a bitwise OR or some of the flags available to QPainter::drawText().

The DontClip and WordBreak flags are not supported.

int QwTextSprite::textFlags () const

Returns the currently set alignment flags.

See also: setTextFlags().

int QwTextSprite::x () const

Returns the X-position of the left edge of the text.

void QwTextSprite::x ( int c )

Sets the X-positions of the bottom-left corner of the text.

int QwTextSprite::y () const

Returns the Y-position of the top edge of the text.

void QwTextSprite::y ( int c )

Sets the Y-positions of the bottom-left corner of the text.

int QwTextSprite::z () const [virtual]

Return the altitude of the text.

Reimplemented from QwSpriteFieldGraphic.

void QwTextSprite::z ( int a )

Sets the altitude of the text.


This file is copyright © 1995-97 Warwick Allison.

It was generated from the following files:


Generated at 09:21, 1998/12/09 for Qt version 1.4 by the warwick at Troll Tech