mprestia
06-10-2009 20:36:50
Hello,
I'm trying to create a HUD for my game. Right now I have 3 separate components: the main face of the HUD, an element that slides out from the main face, and a button (which is really just a StaticImage) on the sliding element.
(I'm reinterpreting the MyGUI wrapper that I wrote, so please forgive me if my syntax is a little off)
This produces the ability button on top of the slider, which is correct. However, the slider appears on top of the main face, which is opposite of what I need. I tried using LayerManager::upLayerItem(...) to bring the main face to the top of the layer, but the slider still appeared on top. I tried changing the widget style of the slider to MyGUI::WidgetStyle::Overlapped and the placement of the widgets went crazy. Is there some other function or property to set the layering of widgets and their children?
I do not have screenshots at the moment, but will gladly post some if they will help.
Thanks,
Mike
I'm trying to create a HUD for my game. Right now I have 3 separate components: the main face of the HUD, an element that slides out from the main face, and a button (which is really just a StaticImage) on the sliding element.
GUIStaticImage* mFace = (StaticImagePtr)(mGUI->createWidget("StaticImage", "StaticImage", 128, 350, 365, 175, MyGUI::Align::Left, "Back", "wristWatch"));
mFace->setImageTexture("Watch.png");
GUIStaticImage* mSlider = (StaticImagePtr)(mGUI->createWidget("StaticImage", "StaticImage", -78, 30, 255, 128, MyGUI::Align::Left, "Back", "abilitySlider"));
mFace->attachToWidget(mFace);
mSlider->setWidgetStyle(MyGUI::WidgetStyle::Child);
mSlider->setImageTexture("SlideOut.png");
GUIStaticImage* mButton = (StaticImagePtr)(mGUI->createWidget("StaticImage", "StaticImage", 48, 32, 50, 50, MyGUI::Align::Left, "Back", "abilityButton"));
mSlider->attachToWidget(mButton);
mButton->setWidgetStyle(MyGUI::WidgetStyle::Child);
mButton->setImageTexture("Button.png");
(I'm reinterpreting the MyGUI wrapper that I wrote, so please forgive me if my syntax is a little off)
This produces the ability button on top of the slider, which is correct. However, the slider appears on top of the main face, which is opposite of what I need. I tried using LayerManager::upLayerItem(...) to bring the main face to the top of the layer, but the slider still appeared on top. I tried changing the widget style of the slider to MyGUI::WidgetStyle::Overlapped and the placement of the widgets went crazy. Is there some other function or property to set the layering of widgets and their children?
I do not have screenshots at the moment, but will gladly post some if they will help.
Thanks,
Mike