Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ObjectGraphics::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
- {
- Creep *creep = dynamic_cast<Creep*>(parent);
- Tower *tower = dynamic_cast<Tower*>(parent);
- if(creep)
- {
- painter->drawRoundedRect(0, 0, 2, 0.5, 1, 1);
- painter->fillRect(0, 0, creep->status()*2, 0.5, Qt::SolidPattern);
- } else if(tower)
- painter->drawRoundedRect(0, 0, 2, 0.5, 1, 1);
- painter->fillRect(0, 0, tower->status()*2, 0.5, Qt::SolidPattern);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement