libkdegames/libkdegamesprivate
kgamecanvas.cpp
Go to the documentation of this file.
698 KGameCanvasRenderedPixmap::KGameCanvasRenderedPixmap(KGameRenderer* renderer, const QString& spriteKey, KGameCanvasAbstract* canvas)
712 KGameCanvasTiledPixmap::KGameCanvasTiledPixmap(const QPixmap& pixmap, const QSize &size, const QPoint &origin,
781 KGameCanvasRectangle::KGameCanvasRectangle(const QColor& color, const QSize &size, KGameCanvasAbstract* KGameCanvas)
void stackUnder(KGameCanvasItem *ref)
Restacks the item immediately under ref.
Definition: kgamecanvas.cpp:473
virtual QRect rect() const
Override this function to return the rect the item will be drawn into.
Definition: kgamecanvas.cpp:694
virtual QRect rect() const
Override this function to return the rect the item will be drawn into.
Definition: kgamecanvas.cpp:819
void setOpacity(qreal opacity)
QSize size() const
virtual void paint(QPainter *p)
Override this function to draw the item with the painter.
Definition: kgamecanvas.cpp:690
QSize size() const
virtual void paint(QPainter *p)
Override this function to draw the item with the painter.
Definition: kgamecanvas.cpp:815
void setMoveOrigin(bool move_orig)
Sets if the origin of the brush will be moved with the pixmap.
Definition: kgamecanvas.cpp:755
void setAnimationDelay(int d)
Set the delay of the animation, in milliseconds.
Definition: kgamecanvas.cpp:215
Definition: kgamecanvas.h:505
int width() const
int width() const
QRect boundingRect() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
int right() const
virtual QRect rect() const
This returns the bouding rect of all children.
Definition: kgamecanvas.cpp:618
KGameCanvasPixmap(const QPixmap &pixmap, KGameCanvasAbstract *canvas=NULL)
Constructor, specifying the pixmap to use.
Definition: kgamecanvas.cpp:670
virtual void paint(QPainter *p)
Override this function to draw the item with the painter.
Definition: kgamecanvas.cpp:927
Definition: kgamecanvas.h:497
virtual void ensurePendingUpdate()=0
Virtual function to ensure an update is pending, called from children.
QList< KGameCanvasItem * > itemsAt(const QPoint &pos) const
Helper function to retrieve all the items at the given position, starting from the topmost one...
Definition: kgamecanvas.cpp:69
QList< KGameCanvasItem * > m_animated_items
Definition: kgamecanvas.h:61
const T & at(int i) const
virtual QRect rect() const
Override this function to return the rect the item will be drawn into.
Definition: kgamecanvas.cpp:772
void removeAt(int i)
bool intersects(const QRect &rectangle) const
QPixmap fromImage(const QImage &image, QFlags< Qt::ImageConversionFlag > flags)
KGameCanvasTiledPixmap(const QPixmap &pixmap, const QSize &size, const QPoint &origin, bool move_orig, KGameCanvasAbstract *canvas=NULL)
Constructor, specifying the pixmap and the parameters to use.
Definition: kgamecanvas.cpp:712
void drawTiledPixmap(const QRectF &rectangle, const QPixmap &pixmap, const QPointF &position)
QRect boundingRect() const
virtual void paint(QPainter *p)=0
Override this function to draw the item with the painter.
KGameCanvasWidget * topLevelCanvas()
returns the toplevel canvas (or null if it is in an orphan tree)
Definition: kgamecanvas.cpp:635
virtual bool layered() const
Override this function to specify if the painting operations will paint over each other...
Definition: kgamecanvas.cpp:400
int mSecs()
Return the number of millisecons from the creation of the canvas (see also KGameCanvasItem::advance) ...
Definition: kgamecanvas.cpp:219
int size() const
KGameCanvasAbstract * canvas() const
Returns the canvas that is actually "owning" the item.
Definition: kgamecanvas.h:192
int indexOf(const T &value, int from) const
Definition: kgamecanvas.h:506
Definition: kgamecanvas.h:495
const QRect & rect() const
KGameCanvasItem * itemAt(const QPoint &pos) const
Helper function to retrieve the topmost item at the given position.
Definition: kgamecanvas.cpp:60
virtual void paint(QPainter *p)
This function does nothing (of course)
Definition: kgamecanvas.cpp:658
QRect boundingRect(QChar ch) const
void setFont(const QFont &font)
virtual void advance(int msecs)
Animations step, updates the animation for the children.
Definition: kgamecanvas.cpp:577
virtual void paint(QPainter *p)
Override this function to draw the item with the painter.
Definition: kgamecanvas.cpp:764
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: kgamecanvas.cpp:827
virtual void paint(QPainter *p)
Override this function to draw the item with the painter.
Definition: kgamecanvas.cpp:966
void append(const T &value)
bool empty() const
Definition: kgamecanvas.h:507
int top() const
void setPen(const QColor &color)
KGameCanvasRectangle(const QColor &color, const QSize &size, KGameCanvasAbstract *canvas=NULL)
Constructor, specifying the pixmap and the parameters to use.
Definition: kgamecanvas.cpp:781
virtual ~KGameCanvasTiledPixmap()
Definition: kgamecanvas.cpp:730
int left() const
QRegion translated(int dx, int dy) const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
int removeAll(const T &value)
void drawText(const QPointF &position, const QString &text)
QRect translated(int dx, int dy) const
bool contains(const QPoint &point, bool proper) const
T & first()
void stackOver(KGameCanvasItem *ref)
Restacks the item immediately over ref.
Definition: kgamecanvas.cpp:449
void syncX()
virtual ~KGameCanvasAbstract()
Definition: kgamecanvas.cpp:54
bool contains(const QPoint &p) const
virtual QPoint canvasPosition() const
Definition: kgamecanvas.cpp:227
int height() const
void putInCanvas(KGameCanvasAbstract *canvas)
Lets you specify the owning canvas.
Definition: kgamecanvas.cpp:336
KGameCanvasPicture(const QPicture &picture, KGameCanvasAbstract *canvas=NULL)
Constructor, specifying the picture to use.
Definition: kgamecanvas.cpp:941
bool isEmpty() const
virtual void invalidate(const QRect &r, bool translate=true)=0
Virtual function to update a rect.
Definition: kgamecanvas.h:496
void repaint()
Definition: kgamecanvas.h:494
KGameCanvasRenderedPixmap(KGameRenderer *renderer, const QString &spriteKey, KGameCanvasAbstract *canvas=0)
Definition: kgamecanvas.cpp:698
virtual void advance(int msecs)
Override this function to handle animations, the default function does nothing.
Definition: kgamecanvas.cpp:402
QSize expandedTo(const QSize &otherSize) const
void insert(int i, const T &value)
virtual QRect rect() const =0
Override this function to return the rect the item will be drawn into.
T & last()
void setOpacity(int o)
Set the item's opacity value (int the 0-255 range)
Definition: kgamecanvas.cpp:391
virtual void ensureAnimating()=0
Virtual function to let know the canvas that it has animated items in it.
int height() const
int bottom() const
QPoint topLeft() const
void setX(int x)
void setY(int y)
virtual QPoint canvasPosition() const =0
void translate(const QPointF &offset)
KGameCanvasItem(KGameCanvasAbstract *canvas=NULL)
Constructor, it allows you to specify the reference canvas or to create an orphan item that will be p...
Definition: kgamecanvas.cpp:234
bool isEmpty() const
virtual QRect rect() const
Override this function to return the rect the item will be drawn into.
Definition: kgamecanvas.cpp:933
void prepend(const T &value)
virtual QPoint canvasPosition() const
Definition: kgamecanvas.cpp:640
virtual void receivePixmap(const QPixmap &pixmap)
Definition: kgamecanvas.cpp:704
void drawPicture(const QPointF &point, const QPicture &picture)
virtual QRect rect() const
Override this function to return the rect the item will be drawn into.
Definition: kgamecanvas.cpp:971
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void updateParent(const QRect &rect)=0
Notify the parent that the adapter content inside rect needs to be redrawn.
virtual ~KGameCanvasRectangle()
Definition: kgamecanvas.cpp:796
virtual void render(QPainter *p)
Draw the items of the adapter using the specified painter.
Definition: kgamecanvas.cpp:994
void setPicture(const QPicture &picture)
Sets the picture of the sprite.
Definition: kgamecanvas.cpp:958
Definition: kgamecanvas.h:504
singleShot
void rect(int *x, int *y, int *width, int *height) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.