|QPoint||canvasPosition () const override|
|virtual void||render (QPainter *p)|
|class KGameCanvasWidget *||topLevelCanvas () override|
|virtual void||updateParent (const QRect &rect)=0|
|Public Member Functions inherited from KGameCanvasAbstract|
|KGameCanvasItem *||itemAt (const QPoint &pos) const|
|KGameCanvasItem *||itemAt (int x, int y) const|
|const QList< KGameCanvasItem * > *||items () const|
|QList< KGameCanvasItem * >||itemsAt (const QPoint &pos) const|
|QList< KGameCanvasItem * >||itemsAt (int x, int y) const|
|Protected Attributes inherited from KGameCanvasAbstract|
|QList< KGameCanvasItem * >||m_animated_items|
|QList< KGameCanvasItem * >||m_items|
A generic adapter for KGameCanvas.
KGameCanvasAdapter can be used to draw content managed by KGameCanvas inside systems which do not use KGameCanvas internally for their rendering.
For example, suppose you have a widget CustomDisplay which paints itself with direct QPainter calls in its paintEvent, and you want to add a complex element to its rendering, which is best implemented via the KGameCanvas abstractions. What you can do is to create a KGameCanvasAdapter subclass, use it just like a KGameCanvasGroup, then call its render member function to have a QPainter object draw it.
A KGameCanvas adapter notifies its parent using the pure virtual function updateParent, which is called when the adapter content is invalidated.
- Support animations
Constructor & Destructor Documentation
Member Function Documentation
The absolute position of the rendered content is not well defined for KGameCanvasAdapter.
We assume that the adapter will be rendered at (0,0), and leave it to the user to perform the necessary adjustments, which will depend on the chosen rendering method.
- The point (0, 0).
Notify the parent that the adapter content inside rect needs to be redrawn.
rect The bounding rectangle of the region that needs repainting.
The documentation for this class was generated from the following files: