4 * Draw a map on the playground.
6 * Copyright: (c) 2007 CTU Dragons
7 * CTU FEE - Department of Control Engineering
8 * Authors: Michal Vokac, Michal Sojka
15 #include "PlaygroundScene.h"
22 QObject(), QGraphicsItem()
26 mapImage = QImage(MAP_WIDTH, MAP_HEIGHT, QImage::Format_ARGB32);
27 mapImage.fill(Qt::transparent);
35 QRectF Map::boundingRect() const
37 return QRectF(0,0,PLAYGROUND_WIDTH_MM,PLAYGROUND_HEIGHT_MM);
40 void Map::paint(QPainter *painter,
41 const QStyleOptionGraphicsItem *option, QWidget *widget)
47 painter->drawImage(QPointF(0, 0), mapImage);
50 void Map::setPixelColor(int x, int y, QColor color)
52 mapImage.setPixel(x, y, color.rgba());