text over custom textbox


13-08-2014 23:09:57

when i create a textbox in the layout editor, (Type=TextBox) it works perfect but when i change the Skin from "TextBox" to "MyTextbox", the background image appears just fine but the text doesn't.

"MyTextbox" skin was created in the skin editor, it's a simple image background i want to change, nothing more, why it's hiding the text?
same if i select "TextBoxSkin". same for EditBox etc...

btw, when creating "MyTextbox", i enable the "Text" feature in the region tab.

i'm used to miyagi gui (skin means "backgroundimage" there)

any tips? :D


14-08-2014 10:58:54

Skin in MyGUI is usually part of texture with stretching rules. When it comes to more than simple piece of texture there are more complex templates, defined in ***Templates.xml
For example in case of TextBox all you need to define in there is default font properties:
<Resource type="ResourceLayout" name="TextBox" version="3.2.0">
<Widget type="Widget" skin="TextBoxSkin" position="20 20 16 16" name="Root">
<Property key="TextAlign" value="Default"/>
<Property key="FontName" value="Default"/>
<Property key="TextColour" value="0 0 0"/>
<UserString key="LE_TargetWidgetType" value="TextBox"/>
In your case template would be same, but with other 'skin' instead of TextBoxSkin.
And inside your ResourceSkin should be one or several SubSkin parts and one SimpleText part.