added box for fps counter and changed font colour to white

actorid
sergoz 14 years ago
parent eb58f22ea5
commit 53ac8776ec

@ -36,7 +36,7 @@ namespace MWGui
class HUD : public OEngine::GUI::Layout class HUD : public OEngine::GUI::Layout
{ {
public: public:
HUD(int width, int height) HUD(int width, int height, bool fpsSwitch)
: Layout("openmw_hud_layout.xml") : Layout("openmw_hud_layout.xml")
{ {
setCoord(0,0, width, height); setCoord(0,0, width, height);
@ -59,8 +59,12 @@ namespace MWGui
getWidget(compass, "Compass"); getWidget(compass, "Compass");
getWidget(crosshair, "Crosshair"); getWidget(crosshair, "Crosshair");
getWidget(fpsbox, "FPSBox");
getWidget(fpscounter, "FPSCounter"); getWidget(fpscounter, "FPSCounter");
fpsbox->setVisible(fpsSwitch);
compass->setImageTexture("textures\\compass.dds"); compass->setImageTexture("textures\\compass.dds");
crosshair->setImageTexture("textures\\target.dds"); crosshair->setImageTexture("textures\\target.dds");
@ -153,6 +157,8 @@ namespace MWGui
MyGUI::StaticImagePtr compass; MyGUI::StaticImagePtr compass;
MyGUI::StaticImagePtr crosshair; MyGUI::StaticImagePtr crosshair;
MyGUI::WidgetPtr fpsbox;
MyGUI::StaticTextPtr fpscounter; MyGUI::StaticTextPtr fpscounter;
}; };

@ -54,7 +54,7 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
int w = gui->getViewSize().width; int w = gui->getViewSize().width;
int h = gui->getViewSize().height; int h = gui->getViewSize().height;
hud = new HUD(w,h); hud = new HUD(w,h, showFPSCounter);
menu = new MainMenu(w,h); menu = new MainMenu(w,h);
map = new MapWindow(); map = new MapWindow();
stats = new StatsWindow (environment); stats = new StatsWindow (environment);

@ -49,11 +49,11 @@
<Widget type="StaticImage" skin="StaticImage" position="0 0 32 <Widget type="StaticImage" skin="StaticImage" position="0 0 32
32" align="Center Center" name="Crosshair"/> 32" align="Center Center" name="Crosshair"/>
<!-- FPSCounter --> <!-- FPSCounter box -->
<Widget type="StaticText" skin="SandText" position="269 173 30 30" align="Right Bottom" <Widget type="Widget" skin="HUD_Box" position="12 12 28 21" align="Left Top"
name="FPSCounter"> name="FPSBox">
<Property key="Widget_AlignText" value="ALIGN_RIGHT ALIGN_BOTTOM"/> <Widget type="StaticText" skin="NumFPS" position="3 3 21 17" name="FPSCounter"/>
</Widget> </Widget>
</Widget> </Widget>

@ -9,6 +9,14 @@
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/> <BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
</Skin> </Skin>
<Skin name = "NumFPS" size = "16 16">
<Property key="FontName" value = "MyGUI_CoreFont.18" />
<Property key="FontHeight" value = "18" />
<Property key="AlignText" value = "ALIGN_RIGHT ALIGN_BOTTOM" />
<Property key="Colour" value = "1 1 1" />
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
</Skin>
<Skin name = "SandText" size = "16 16"> <Skin name = "SandText" size = "16 16">
<Property key="FontName" value = "MyGUI_CoreFont.18" /> <Property key="FontName" value = "MyGUI_CoreFont.18" />
<Property key="FontHeight" value = "18" /> <Property key="FontHeight" value = "18" />

Loading…
Cancel
Save