This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a simple game state inspired from a good article about managing game states | |
at http://gamedevgeek.com/tutorials/managing-game-states-in-c/ , i tried to adapt it in Urho3d | |
using events rather than loops update on virtual methods that kill performance. | |
*/ | |
gamestateshandler expect a scene already create , you can simply modified as you like, | |
main.cpp{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
bool isUrho3dRock = true ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(){ | |
//load layout | |
XMLFile* xmlFile = cache->GetResource<XMLFile>(layoutName); | |
SharedPtr<UIElement> lay =GetContext()->GetSubsystem<UI>()->LoadLayout(xmlFile); | |
GetContext()->GetSubsystem<UI>()->GetRoot()->AddChild(lay); | |
Vector2 resEditor (1920,1080);// this is the resolution used in the editor - could be came from .xml | |
Vector2 currentResolution (1600,1080); // current resolution from EngineParameters | |
GuiHelper::ReDraw(lay,resEditor,currentResolution); | |