granatier
elementitem.cpp
Go to the documentation of this file.
26 ElementItem::ElementItem(Element* p_model, KGameRenderer* renderer) : KGameRenderedItem(renderer, "")
79 QPoint viewBottomRight = scene()->views().first()->mapFromScene(m_itemSizeSet.width(), m_itemSizeSet.height());
84 //for better alignment, if the item size is different from the cell size, make the difference between the cell size and item size always even
85 if(m_itemSizeSet.width() != Granatier::CellSize || m_itemSizeSet.height() != Granatier::CellSize)
87 viewBottomRight = scene()->views().first()->mapFromScene(Granatier::CellSize, Granatier::CellSize);
ElementItem(Element *p_model, KGameRenderer *renderer)
Creates a new ElementItem instance.
Definition: elementitem.cpp:26
virtual void update(qreal p_x, qreal p_y)
Updates the ElementItem coordinates.
Definition: elementitem.cpp:55
Element * m_model
The instance of Element the ElementItem will represent.
Definition: elementitem.h:40
virtual void updateGraphicsInternal(qreal svgScaleFactor)
Definition: elementitem.cpp:70
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:32
QPainterPath shape() const
Reimplement QGraphicsItem::shape() to return an ellipse to improve collisions.
Definition: elementitem.cpp:48
virtual void updateGraphics(qreal svgScaleFactor)
Updates the graphics after a resize.
Definition: elementitem.cpp:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.