Newtonian gravity field info in HUD (Maybe we could have an arrow to show direction in future). Fixed #152

This commit is contained in:
Simon Robertshaw 2012-09-05 17:02:03 +01:00
parent 3f43763695
commit d379390d06
2 changed files with 5 additions and 3 deletions

View File

@ -290,9 +290,9 @@ void GameModel::BuildMenus()
brushList.push_back(new TriangleBrush(ui::Point(4, 4)));
//Set default tools
activeTools[0] = GetToolFromIdentifier("DEFAULT_PT_DUST");//menuList[SC_POWDERS]->GetToolList()[0];
activeTools[1] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE");//menuList[SC_SPECIAL]->GetToolList()[0];
activeTools[2] = GetToolFromIdentifier("DEFAULT_PT_NONE");//menuList[SC_TOOL]->GetToolList()[0];
activeTools[0] = GetToolFromIdentifier("DEFAULT_PT_DUST");
activeTools[2] = GetToolFromIdentifier("DEFAULT_PT_NONE");
activeTools[1] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE");
if(activeToolIdentifiers[0].length())
activeTools[0] = GetToolFromIdentifier(activeToolIdentifiers[0]);

View File

@ -2004,6 +2004,8 @@ void GameView::OnDraw()
sampleInfo << "#" << sample.ParticleID << ", ";
}
sampleInfo << "X:" << sample.PositionX << " Y:" << sample.PositionY;
if (std::abs(sample.Gravity) > 0.1f)
sampleInfo << " GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY;
textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str());
g->fillrect(XRES-20-textWidth, 26, textWidth+8, 15, 0, 0, 0, 255*0.5);