From a0f7ab0f77fa81b77d03de751e4a5f4e07c49d25 Mon Sep 17 00:00:00 2001 From: Samu Laaksonen Date: Thu, 18 Oct 2012 23:58:18 +0300 Subject: Box2d precommit Added - box2d source codes to be added in project when there is no longer cba - some base ideas to display classes Improved - level loading : layer with property "solid" is now loaded tile by tile, this allows adding static rigid bodies to these items for collision detection --- src/CircularDisplay.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/CircularDisplay.cpp') diff --git a/src/CircularDisplay.cpp b/src/CircularDisplay.cpp index 2c723c3..438ebc0 100644 --- a/src/CircularDisplay.cpp +++ b/src/CircularDisplay.cpp @@ -1,7 +1,8 @@ +#include #include "CircularDisplay.h" -CircularDisplay::CircularDisplay() : - QPixmap() +CircularDisplay::CircularDisplay(int w, int h) : + QPixmap(w, h) { m_partCount = 5; m_maxValue = 50; @@ -9,6 +10,22 @@ CircularDisplay::CircularDisplay() : m_value = 10; m_activated = false; + fill(QColor(Qt::transparent)); + + QPainter p(this); + QPen pen(QColor(0, 0, 0, 255)); + p.setPen(pen); + + // draw base ellipse + p.drawEllipse(45, 45, 35, 35); + + // draw "tick" lines + p.drawLine(45, 10, 45, 0); // 12 o'clock + p.drawLine(62.5, 27.5, 70, 20); // 1.5 o'clock + p.drawLine(80, 45, 90, 45); // 3 o'clock + p.drawLine(62.5, 62.5, 70, 70); // 4.5 o'clock + p.drawLine(45, 80, 80, 90); // 6 o'clock + /* TODO: initialize this item with some kind of rounds graphics that supports partitioning -- cgit v1.2.3