diff options
| author | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-10-18 23:58:18 +0300 |
|---|---|---|
| committer | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-10-18 23:58:18 +0300 |
| commit | a0f7ab0f77fa81b77d03de751e4a5f4e07c49d25 (patch) | |
| tree | 92c033e000f6796f3e679ee8ba58bf83844b84c5 /src/CircularDisplay.cpp | |
| parent | 2049e08432907f645f5a3786ea4f50a6456b77c4 (diff) | |
| download | prism-a0f7ab0f77fa81b77d03de751e4a5f4e07c49d25.tar.gz prism-a0f7ab0f77fa81b77d03de751e4a5f4e07c49d25.zip | |
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
Diffstat (limited to 'src/CircularDisplay.cpp')
| -rw-r--r-- | src/CircularDisplay.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
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 <QPainter> #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 |
