brick
03-02-2009 13:24:12
I have the following layout:
Create with:
How can I pick out the progress bar widget from the HUD? I would expect hud->findWidget("HealthBar") to work, but it doesn't. Apparently, the 'name' tag isn't meant for this purpose, although this would be the intuitive behavior.
I've also tried iterating through hud's child widgets with getEnumerator(), but the list is empty.
Is this possible? As it stands now, it looks like it's impossible to define the HUD without hard-coding all the positions.
<Skin name="HUD" size="300 200">
<Child type="Progress" skin="MyProgressSkin" offset="13 146 65 12" align="ALIGN_LEFT ALIGN_BOTTOM" name="HealthBar"/>
</Skin>
Create with:
MyGUI::WidgetPtr hud;
hud = mGUI->createWidget<MyGUI::Widget>
("HUD", 0, 0, mWidth, mHeight, MyGUI::ALIGN_LEFT | MyGUI::ALIGN_TOP, "Back");
How can I pick out the progress bar widget from the HUD? I would expect hud->findWidget("HealthBar") to work, but it doesn't. Apparently, the 'name' tag isn't meant for this purpose, although this would be the intuitive behavior.
I've also tried iterating through hud's child widgets with getEnumerator(), but the list is empty.
Is this possible? As it stands now, it looks like it's impossible to define the HUD without hard-coding all the positions.