add svg sprite source
[blok] / blokitem / totemblokitem.cpp
1 #include "totemblokitem.h"
2
3 TotemBlokItem::TotemBlokItem(int width,int height,QObject *parent) :
4         BlokItem(width, height,parent)
5 {
6     setTotem(YELLOW_TOTEM);
7     QPen pen;
8     pen.setColor(Qt::transparent);
9     setPen(pen);
10 }
11
12
13 void TotemBlokItem::setTotem(Totem _totem)
14 {
15     mCurrentTotem = _totem;
16
17     if ( mCurrentTotem == YELLOW_TOTEM)
18     {
19         setBrush(QBrush(QPixmap(":sprites/totem1_block.png")));
20     }
21
22     if ( mCurrentTotem == BLUE_TOTEM)
23     {
24         setBrush(QBrush(QPixmap(":sprites/totem2_block.png")));
25
26     }
27
28     if ( mCurrentTotem == RED_TOTEM)
29     {
30         setBrush(QBrush(QPixmap(":sprites/totem3_block.png")));
31
32     }
33
34
35
36 }