• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

KGameCanvasText Class Reference

#include <KGameCanvas>

Inheritance diagram for KGameCanvasText:

Inheritance graph
[legend]

List of all members.


Detailed Description

KGameCanvasText.

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

Definition at line 450 of file kgamecanvas.h.


Public Types

enum  HPos { HStart, HLeft, HRight, HCenter }
enum  VPos { VBaseline, VTop, VBottom, VCenter }

Public Member Functions

QColor color () const
QFont font () const
HPos hPositioning () const
 KGameCanvasText (KGameCanvasAbstract *canvas=NULL)
 KGameCanvasText (const QString &text, const QColor &color, const QFont &font, HPos hp, VPos vp, KGameCanvasAbstract *canvas=NULL)
virtual bool layered () const
virtual void paint (QPainter *p)
virtual QRect rect () const
void setColor (const QColor &color)
void setFont (const QFont &font)
void setPositioning (HPos hp, VPos vp)
void setText (const QString &text)
QString text () const
VPos vPositioning () const
virtual ~KGameCanvasText ()

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

QColor KGameCanvasText::color (  )  const [inline]

Returns the color.

Definition at line 502 of file kgamecanvas.h.

QFont KGameCanvasText::font (  )  const [inline]

Returns the font.

Definition at line 508 of file kgamecanvas.h.

HPos KGameCanvasText::hPositioning (  )  const [inline]

Returns the horizontal positioning style.

Definition at line 514 of file kgamecanvas.h.

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.

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.

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.

void KGameCanvasText::setColor ( const QColor &  color  ) 

Sets the color.

Definition at line 862 of file kgamecanvas.cpp.

void KGameCanvasText::setFont ( const QFont &  font  ) 

Sets the font.

Definition at line 866 of file kgamecanvas.cpp.

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

Sets the positioning style.

Definition at line 874 of file kgamecanvas.cpp.

void KGameCanvasText::setText ( const QString &  text  ) 

Sets the text.

Definition at line 852 of file kgamecanvas.cpp.

QString KGameCanvasText::text (  )  const [inline]

Returns the text.

Definition at line 496 of file kgamecanvas.h.

VPos KGameCanvasText::vPositioning (  )  const [inline]

Returns the vertical positioning style.

Definition at line 517 of file kgamecanvas.h.


The documentation for this class was generated from the following files:
  • kgamecanvas.h
  • kgamecanvas.cpp

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal