help with leyout editor

nevarim

05-01-2017 20:13:25

hi all i have 2 questions:

i made with skineditor a file with 2 buttons with 4 action, but how can i add them into leyout editor? which is the file i must edit ?

iused the file attache, buttons are not regular, how can i make by code for to use only "visible" surface?
thanks for help
Neva




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

-<MyGUI version="1.1" type="Resource">


-<Resource type="ResourceSkin" texture="buttons.png" size="115 56" name="btn1">


-<BasisSkin type="SubSkin" align="Stretch" offset="0 0 115 56">

<State name="disabled" offset="268 705 115 56"/>

<State name="normal" offset="21 705 115 56"/>

<State name="highlighted" offset="394 705 115 56"/>

<State name="pushed" offset="143 705 115 56"/>

</BasisSkin>

</Resource>


-<Resource type="ResourceSkin" texture="buttons.png" size="116 56" name="btn2">


-<BasisSkin type="SubSkin" align="Stretch" offset="0 0 116 56">

<State name="disabled" offset="266 643 116 56"/>

<State name="normal" offset="19 643 116 56"/>

<State name="highlighted" offset="392 643 116 56"/>

<State name="pushed" offset="141 643 116 56"/>

</BasisSkin>

</Resource>


-<Resource type="ResourceSkin" texture="buttons.png" size="116 56" name="btn3">


-<BasisSkin type="SubSkin" align="Stretch" offset="0 0 116 56">

<State name="disabled" offset="265 581 116 56"/>

<State name="normal" offset="18 581 116 56"/>

<State name="highlighted" offset="391 581 116 56"/>

<State name="pushed" offset="140 581 116 56"/>

</BasisSkin>

</Resource>


-<Resource type="ResourceSkin" texture="buttons.png" size="117 56" name="btn4">


-<BasisSkin type="SubSkin" align="Stretch" offset="0 0 117 56">

<State name="disabled" offset="266 517 117 56"/>

<State name="normal" offset="19 517 117 56"/>

<State name="highlighted" offset="392 517 117 56"/>

<State name="pushed" offset="141 517 117 56"/>

</BasisSkin>

</Resource>


-<Resource type="ResourceSkin" texture="buttons.png" size="116 56" name="btn5">


-<BasisSkin type="SubSkin" align="Stretch" offset="0 0 116 56">

<State name="disabled" offset="266 456 116 56"/>

<State name="normal" offset="19 456 116 56"/>

<State name="highlighted" offset="392 456 116 56"/>

<State name="pushed" offset="141 456 116 56"/>

</BasisSkin>

</Resource>

</MyGUI>

Altren

06-01-2017 20:44:08

In LayoutEditor: File->Settings, then in "Folders" add folders with your images and skin files, and in "Resources" add your xml files with skins (just file names, because you already added full path in "Folders"). Afterwards editor restart is required.
Then you will be able to select your custom skins in dropdown menu in newly created widgets.

Also you can create custom xml for LayoutEditor to make it add new tab with only your skins and add in into Resources as well:
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Widgets">
<Widget name="Button">
<Property key="DefaultSkin" value="Button"/>
<Property key="Skin" value="MyButton1" group="My Skins"/>
<Property key="Skin" value="MyButton2" group="My Skins"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="StateSelected" value="Bool"/>
<Parameter key="ModeImage" value="Bool"/>
<Parameter key="ImageResource" value="String"/>
<Parameter key="ImageGroup" value="String"/>
<Parameter key="ImageName" value="String"/>
</Widget>
</MyGUI>
For reference see Media/Tools/LayoutEditor/Settings/Widgets.xml
[attachment=0]CustomSkins.png[/attachment]

nevarim

07-01-2017 09:21:31

hi altren

thanks for help

i made as you told in option but when i go into menu widget i have this result, i don't have my widget


for the second question there is a way to do this?
iused the file attache, buttons are not regular, how can i make by code for to use only "visible" surface?
thanks
Neva

Altren

08-01-2017 11:20:36

May be you are using some old MyGUI version and that's why you can't add custom skins into Layout Editor.
What about non-rectangular buttons: you need to use MaskPick texture, that would define widget's borders.

nevarim

08-01-2017 19:59:43

downloaded mygui version binary on mygui.info

Altren

10-01-2017 13:10:36

Yeah, prebuilt tools are very old there. You should download latest MyGUI version from gihub: https://github.com/MyGUI/mygui

nevarim

17-01-2017 16:42:25

nothing to do, compiled latest versin and my skins won't appear, i have in that screen also _dark but not my skins

just for to be sure this is my mygui folder
http://naiora.hostinggratis.it/upload/public/Mygui.zip

nevarim

19-01-2017 23:48:54

ok i solved when you told that i have to create skins, i must create xml of skins and then i MUST create in layout settings xml the rows for custom buttons is not a choice :D