rotate hud player arrow

actorid
scrawl 13 years ago
parent 06fa310e29
commit ce63d29d4a

@ -142,3 +142,13 @@ void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<int>& v
} }
} }
} }
void HUD::setPlayerDir(const float x, const float y)
{
MyGUI::ISubWidget* main = compass->getSubWidgetMain();
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
float angle = std::atan2(x,y);
rotatingSubskin->setAngle(angle);
}

@ -46,6 +46,8 @@ namespace MWGui
void setTriangleCount(size_t count); void setTriangleCount(size_t count);
void setBatchCount(size_t count); void setBatchCount(size_t count);
void setPlayerDir(const float x, const float y);
MyGUI::ProgressPtr health, magicka, stamina; MyGUI::ProgressPtr health, magicka, stamina;
MyGUI::ImageBox *weapImage, *spellImage; MyGUI::ImageBox *weapImage, *spellImage;
MyGUI::ProgressPtr weapStatus, spellStatus; MyGUI::ProgressPtr weapStatus, spellStatus;

@ -433,4 +433,5 @@ void WindowManager::setPlayerPos(const float x, const float y)
void WindowManager::setPlayerDir(const float x, const float y) void WindowManager::setPlayerDir(const float x, const float y)
{ {
map->setPlayerDir(x,y); map->setPlayerDir(x,y);
hud->setPlayerDir(x,y);
} }

@ -40,7 +40,7 @@
align="Right Bottom"> align="Right Bottom">
<Widget type="ImageBox" skin="ImageBox" position="2 2 61 61" align="Left Bottom" <Widget type="ImageBox" skin="ImageBox" position="2 2 61 61" align="Left Bottom"
name="MiniMap"/> name="MiniMap"/>
<Widget type="ImageBox" skin="ImageBox" position="17 18 32 32" align="Left Bottom" <Widget type="ImageBox" skin="RotatingSkin" position="17 18 32 32" align="Left Bottom"
name="Compass"/> name="Compass"/>
</Widget> </Widget>

Loading…
Cancel
Save