If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
From the MyGUI Ogre forums, posted by my.name 2010 May 24.
Preserved here because dpaste is going to delete the sample code tomorrow (2010 June 22).
<Widget type="Button" skin="ButtonImage" position="10 280 98 18" layer="Back"> <Property key="Button_ImageResource" value="pic_ButtonImage1"/> <Property key="Button_ModeImage" value="true"/> </Widget>
These properties are supported by the MyGUI Layout Editor. The value of Button_ImageResource should match the name= attribute of the Resource element below. This layout fragment is incomplete. The snippet should be used somewhere within a complete layout.
<?xml version="1.0" encoding="UTF-8"?> <MyGUI type="Resource"> <Resource type="ResourceImageSet" name="pic_ButtonImage1"> <Group name="States" texture="core.png" size="50 50"> <Index name="disabled"> <Frame point="0 203"/> </Index> <Index name="normal"> <Frame point="50 203"/> </Index> <Index name="highlighted"> <Frame point="100 203"/> </Index> <Index name="pushed"> <Frame point="150 203"/> </Index> </Group> </Resource> </MyGUI>
The resource file is complete and may be used as-is (though pointing at core.png isn't necessarily useful).
The Resource must be explicitly loaded:
MyGUI::ResourceManager::getInstance().load("ButtonImage.resource");
This HowTo also applies to ButtonImageText, with the addition that the property Widget_Caption is supported within the button layout.
Contributors to this page: DragonM
.
Page last modified on Tuesday 22 of June, 2010 01:14:05 UTC by DragonM
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.

