KGameCanvasPixmap

Search for usage in LXR

KGameCanvasPixmap Class Reference

#include <KGameCanvas>

Inheritance diagram for KGameCanvasPixmap:

Public Member Functions

 KGameCanvasPixmap (const QPixmap &pixmap, KGameCanvasAbstract *canvas=nullptr)
 
 KGameCanvasPixmap (KGameCanvasAbstract *canvas=nullptr)
 
bool layered () const override
 
void paint (QPainter *p) override
 
QPixmap pixmap () const
 
QRect rect () const override
 
void setPixmap (const QPixmap &pixmap)
 
- Public Member Functions inherited from KGameCanvasItem
 KGameCanvasItem (KGameCanvasAbstract *canvas=nullptr)
 
QPoint absolutePosition () const
 
virtual void advance (int msecs)
 
bool animated () const
 
KGameCanvasAbstractcanvas () const
 
virtual void changed ()
 
void hide ()
 
void lower ()
 
void moveTo (const QPoint &newpos)
 
void moveTo (int x, int y)
 
int opacity () const
 
QPoint pos () const
 
void putInCanvas (KGameCanvasAbstract *canvas)
 
void raise ()
 
void setAnimated (bool a)
 
void setOpacity (int o)
 
void setVisible (bool v)
 
void show ()
 
void stackOver (KGameCanvasItem *ref)
 
void stackUnder (KGameCanvasItem *ref)
 
KGameCanvasWidgettopLevelCanvas () const
 
bool visible () const
 

Detailed Description

A pixmap (sprite).

A KGameCanvasPixmap is a pixmap that can be put in the canvas.

Deprecated:
For new applications, use Qt's Graphics View framework or Qt Quick.

Definition at line 362 of file kgamecanvas.h.

Constructor & Destructor Documentation

◆ KGameCanvasPixmap() [1/2]

KGameCanvasPixmap::KGameCanvasPixmap ( const QPixmap pixmap,
KGameCanvasAbstract canvas = nullptr 
)
explicit

Constructor, specifying the pixmap to use.

Definition at line 679 of file kgamecanvas.cpp.

◆ KGameCanvasPixmap() [2/2]

KGameCanvasPixmap::KGameCanvasPixmap ( KGameCanvasAbstract canvas = nullptr)
explicit

Constructor, creating with an empty pixmap.

Definition at line 685 of file kgamecanvas.cpp.

Member Function Documentation

◆ layered()

bool KGameCanvasPixmap::layered ( ) const
inlineoverridevirtual

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 387 of file kgamecanvas.h.

◆ paint()

void KGameCanvasPixmap::paint ( QPainter p)
overridevirtual

Override this function to draw the item with the painter.

Implements KGameCanvasItem.

Definition at line 701 of file kgamecanvas.cpp.

◆ pixmap()

QPixmap KGameCanvasPixmap::pixmap ( ) const
inline

Returns the pixmap.

Definition at line 377 of file kgamecanvas.h.

◆ rect()

QRect KGameCanvasPixmap::rect ( ) const
overridevirtual

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

Implements KGameCanvasItem.

Definition at line 706 of file kgamecanvas.cpp.

◆ setPixmap()

void KGameCanvasPixmap::setPixmap ( const QPixmap pixmap)

Sets the pixmap of the sprite.

Definition at line 694 of file kgamecanvas.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 29 2023 03:48:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.