X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpainter.cpp;h=6145638c8a022080a30aab44122498ff0fcd9eb1;hb=143b369c0308a8cd524cb0ed51c5d67d6be69603;hp=a649306c74ecd96be81cbba047c8cba253be5d99;hpb=e8987f4028a1f9c0eeb33a45bd11b2e409b9c2c5;p=architektonas diff --git a/src/painter.cpp b/src/painter.cpp index a649306..6145638 100644 --- a/src/painter.cpp +++ b/src/painter.cpp @@ -15,6 +15,7 @@ #include "painter.h" #include "mathconstants.h" +#include "object.h" // Set class variable defaults @@ -292,3 +293,22 @@ void Painter::DrawCrosshair(Vector point) painter->drawLine(screenPoint.x, 0, screenPoint.x, screenSize.y); } + +void Painter::DrawInformativeText(QString text) +{ + painter->setFont(*Object::font); + QRectF bounds = painter->boundingRect(QRectF(), Qt::AlignVCenter, text); + bounds.moveTo(17.0, 17.0); + QRectF textRect = bounds; + textRect.adjust(-7.0, -7.0, 7.0, 7.0); + + QPen pen = QPen(QColor(0x00, 0xFF, 0x00), 1.0, Qt::SolidLine); + painter->setPen(pen); + painter->setBrush(QBrush(QColor(0x40, 0xFF, 0x40, 0x9F))); + painter->drawRoundedRect(textRect, 7.0, 7.0); + + pen = QPen(QColor(0x00, 0x5F, 0xDF)); + painter->setPen(pen); + painter->drawText(bounds, Qt::AlignVCenter, text); +} +