HUD hole size based on percentage not pixels

This commit is contained in:
James Alliban 2014-01-11 03:47:53 +00:00
parent 2874d497b4
commit 73081efcd2
7 changed files with 13 additions and 11 deletions

View File

@ -65,13 +65,13 @@
</Widget> </Widget>
<Widget> <Widget>
<Kind>4</Kind> <Kind>4</Kind>
<Name>Radius Width</Name> <Name>Hole Width Percent</Name>
<Value>829.532897949</Value> <Value>0.875000000</Value>
</Widget> </Widget>
<Widget> <Widget>
<Kind>4</Kind> <Kind>4</Kind>
<Name>Radius Height</Name> <Name>Hole Height Percent</Name>
<Value>612.536193848</Value> <Value>1.019736886</Value>
</Widget> </Widget>
<Widget> <Widget>
<Kind>4</Kind> <Kind>4</Kind>

View File

@ -16,6 +16,6 @@
<Widget> <Widget>
<Kind>6</Kind> <Kind>6</Kind>
<Name>Graph X begin/end (percent)</Name> <Name>Graph X begin/end (percent)</Name>
<HighValue>0.838815808</HighValue> <HighValue>0.786184192</HighValue>
<LowValue>0.069078945</LowValue> <LowValue>0.059210528</LowValue>
</Widget> </Widget>

View File

@ -162,8 +162,8 @@ void GUI::addBackgroundGUI()
gui->addSlider("Green .", 0, 255, &app->scene.hudColour[1], length, dim); gui->addSlider("Green .", 0, 255, &app->scene.hudColour[1], length, dim);
gui->addSlider("Blue .", 0, 255, &app->scene.hudColour[2], length, dim); gui->addSlider("Blue .", 0, 255, &app->scene.hudColour[2], length, dim);
gui->addSlider("Alpha .", 0, 255, &app->scene.hudColour[3], length, dim); gui->addSlider("Alpha .", 0, 255, &app->scene.hudColour[3], length, dim);
gui->addSlider("Radius Width", 1, 2000, &app->scene.radiusW, length, dim); gui->addSlider("Hole Width Percent", 0, 2, &app->scene.hudHoleWidthPercentage, length, dim);
gui->addSlider("Radius Height", 1, 2000, &app->scene.radiusH, length, dim); gui->addSlider("Hole Height Percent", 0, 2, &app->scene.hudHoleHeightPercentage, length, dim);
gui->addSlider("Circle Point Size", 0, 100, &app->scene.circlePointSize, length, dim); gui->addSlider("Circle Point Size", 0, 100, &app->scene.circlePointSize, length, dim);
ofAddListener(gui->newGUIEvent, this, &GUI::variousGUIEvent); ofAddListener(gui->newGUIEvent, this, &GUI::variousGUIEvent);

View File

@ -5,7 +5,6 @@
// - Make HUD BG hole size a percentage rather than pixels // - Make HUD BG hole size a percentage rather than pixels
// - Add option to resize video draw size (rather than making it fullscreen) and init size // - Add option to resize video draw size (rather than making it fullscreen) and init size
// - Make system to slow down data - The screen should show 15-20 minutes worth of data // - Make system to slow down data - The screen should show 15-20 minutes worth of data
// - add ability to remove the lines or body from body graph
// - Make 3rd graph - separate fade // - Make 3rd graph - separate fade
// - Crosshairs in HUD // - Crosshairs in HUD
// - Create graph animation system // - Create graph animation system

View File

@ -76,6 +76,9 @@ void Scene::drawHUDBG()
ofVertex(0, ofGetHeight()); ofVertex(0, ofGetHeight());
ofNextContour(true); ofNextContour(true);
float radiusW = (ofGetWidth() * 0.5) * hudHoleWidthPercentage;
float radiusH = (ofGetHeight() * 0.5) * hudHoleHeightPercentage;
for (int i = 0; i < (int)circlePointSize; i++) for (int i = 0; i < (int)circlePointSize; i++)
{ {

View File

@ -55,8 +55,8 @@ public:
// HUD background vars // HUD background vars
float hudColour[4]; float hudColour[4];
float circlePointSize; float circlePointSize;
float radiusW; float hudHoleWidthPercentage;
float radiusH; float hudHoleHeightPercentage;
// text vars // text vars
float xMargin; float xMargin;