KGameCanvasText Class Reference

#include <kgamecanvas.h>

Inheritance diagram for KGameCanvasText:

Inheritance graph
[legend]
Collaboration diagram for KGameCanvasText:

Collaboration graph
[legend]

List of all members.

Public Types

enum  HPos { HStart, HLeft, HRight, HCenter }
 Specifies the meaning of the x coordinate of the item. More...
enum  VPos { VBaseline, VTop, VBottom, VCenter }
 Specifies the meaning of the y coordinate of the item. More...

Public Member Functions

 KGameCanvasText (const QString &text, const QColor &color, const QFont &font, HPos hp, VPos vp, KGameCanvasAbstract *canvas=NULL)
 Constructor, specifying the text and the parameters to use.
 KGameCanvasText (KGameCanvasAbstract *canvas=NULL)
 Constructor, creating with an empty text.
virtual ~KGameCanvasText ()
QString text () const
 Returns the text.
void setText (const QString &text)
 Sets the text.
QColor color () const
 Returns the color.
void setColor (const QColor &color)
 Sets the color.
QFont font () const
 Returns the font.
void setFont (const QFont &font)
 Sets the font.
HPos hPositioning () const
 Returns the horizontal positioning style.
VPos vPositioning () const
 Returns the vertical positioning style.
void setPositioning (HPos hp, VPos vp)
 Sets the positioning style.
virtual void paint (QPainter *p)
 Override this function to draw the item with the painter.
virtual QRect rect () const
 Override this function to return the rect the item will be drawn into.
virtual bool layered () const
 Override this function to specify if the painting operations will paint over each other.


Detailed Description

KGameCanvasText.

A KGameCanvasText is a text that can be put in the canvas.

Definition at line 450 of file kgamecanvas.h.


Member Enumeration Documentation

enum KGameCanvasText::HPos

Specifies the meaning of the x coordinate of the item.

It can refer to the start of the text, of the left, center, right of the bounding rectangle.

Enumerator:
HStart 
HLeft 
HRight 
HCenter 

Definition at line 456 of file kgamecanvas.h.

enum KGameCanvasText::VPos

Specifies the meaning of the y coordinate of the item.

It can refer to the baseline of the text, of the top, center, bottom of the bounding rectangle.

Enumerator:
VBaseline 
VTop 
VBottom 
VCenter 

Definition at line 466 of file kgamecanvas.h.


Constructor & Destructor Documentation

KGameCanvasText::KGameCanvasText ( const QString &  text,
const QColor &  color,
const QFont &  font,
HPos  hp,
VPos  vp,
KGameCanvasAbstract canvas = NULL 
)

Constructor, specifying the text and the parameters to use.

Definition at line 817 of file kgamecanvas.cpp.

KGameCanvasText::KGameCanvasText ( KGameCanvasAbstract canvas = NULL  ) 

Constructor, creating with an empty text.

Definition at line 829 of file kgamecanvas.cpp.

KGameCanvasText::~KGameCanvasText (  )  [virtual]

Definition at line 839 of file kgamecanvas.cpp.


Member Function Documentation

QString KGameCanvasText::text (  )  const [inline]

Returns the text.

Definition at line 496 of file kgamecanvas.h.

void KGameCanvasText::setText ( const QString &  text  ) 

Sets the text.

Definition at line 852 of file kgamecanvas.cpp.

References KGameCanvasItem::canvas(), KGameCanvasItem::changed(), and KGameCanvasItem::visible().

Here is the call graph for this function:

QColor KGameCanvasText::color (  )  const [inline]

Returns the color.

Definition at line 502 of file kgamecanvas.h.

void KGameCanvasText::setColor ( const QColor &  color  ) 

Sets the color.

Definition at line 862 of file kgamecanvas.cpp.

QFont KGameCanvasText::font (  )  const [inline]

Returns the font.

Definition at line 508 of file kgamecanvas.h.

void KGameCanvasText::setFont ( const QFont &  font  ) 

Sets the font.

Definition at line 866 of file kgamecanvas.cpp.

References KGameCanvasItem::canvas(), KGameCanvasItem::changed(), and KGameCanvasItem::visible().

Here is the call graph for this function:

HPos KGameCanvasText::hPositioning (  )  const [inline]

Returns the horizontal positioning style.

Definition at line 514 of file kgamecanvas.h.

VPos KGameCanvasText::vPositioning (  )  const [inline]

Returns the vertical positioning style.

Definition at line 517 of file kgamecanvas.h.

void KGameCanvasText::setPositioning ( HPos  hp,
VPos  vp 
)

Sets the positioning style.

Definition at line 874 of file kgamecanvas.cpp.

References KGameCanvasItem::pos().

Here is the call graph for this function:

void KGameCanvasText::paint ( QPainter *  p  )  [virtual]

Override this function to draw the item with the painter.

Implements KGameCanvasItem.

Definition at line 917 of file kgamecanvas.cpp.

References KGameCanvasItem::pos().

Here is the call graph for this function:

QRect KGameCanvasText::rect (  )  const [virtual]

Override this function to return the rect the item will be drawn into.

Implements KGameCanvasItem.

Definition at line 923 of file kgamecanvas.cpp.

References KGameCanvasItem::pos().

Here is the call graph for this function:

virtual bool KGameCanvasText::layered (  )  const [inline, virtual]

Override this function to specify if the painting operations will paint over each other.

If not, the item will be drawn more quickly when opacity is != 255, because it does not have to be painted onto a pixmap first. If you don't care about the item's opacity, don't care about this function as well.

Reimplemented from KGameCanvasItem.

Definition at line 524 of file kgamecanvas.h.


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 08:03:17 2008 for Libkdegames by  doxygen 1.5.3