can't see the buttonimage

planB

01-09-2010 01:48:12

hi, there!
i want to use buttonimage to show some pic, but i can't see it though i do it following the mygui wiki.

my Resources.xml, mainly from the Demo_ItemBox.

<?xml version="1.0" encoding="UTF-8"?>

<MyGUI type="Resource">
<Resource type="ResourceImageSet" name="pic_Crystal_Clear_Item1" id="{E1A6EEE1-1E84-4e55-87F7-E64ABB422991}">
<Group name="States" texture="Crystal_Clear_Items.png" size="74 74">
<Index name="Normal">
<Frame point="0 0"/>
</Index>
<Index name="Refuse">
<Frame point="0 74"/>
</Index>
<Index name="Accept">
<Frame point="0 148"/>
</Index>
</Group>
<Group name="ToolTip" texture="Crystal_Clear_Items.png" size="32 32">
<Index name="Normal">
<Frame point="5 251"/>
</Index>
</Group>
</Resource></MyGUI>


my app code,

MyGUI::ResourceManager::getInstance().load("Resources.xml");

mButton=mGUI->createWidget<MyGUI::Button>("ButtonImage",500, 150, 90, 96, MyGUI::Align::Default, "Main");
mButton->setModeImage(true);
mButton->setProperty("Button_ImageResource","pic_Crystal_Clear_Item1");


but when run the app, i can't see a buttonimage.
what's wrong about this?

planB

01-09-2010 01:56:12

then i try another method that load a buttonimage from the layout file.

my buttonimage.layout,

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Button" skin="ButtonImage" position="232 152 176 80" layer="Back">
<Property key="Button_ModeImage" value="true"/>
<Property key="Button_ImageResource" value="pic_Crystal_Clear_Item1"/>
</Widget>
</MyGUI>


and the app code,

MyGUI::ResourceManager::getInstance().load("Resources.xml");

MyGUI::LayoutManager::getInstance().load("buttonimage.layout");


but i can't see the buttonimage still.

ps: there isn't any error in the mygui.log as the above post.

my.name

01-09-2010 09:24:51

try
<Index name="normal">