Calling
SetStyleAuto()
on a UI element is translated to
SetStyle("ClassName")
where ClassName is the name of the UI element’s class. It then searches for the name in the xml file set in
SetDefaultStyle()
. If you subclass from
Button
for example and call the new class
MyButton
, calling
SetStyleAuto()
will search for “MyButton” in the default style. If you don’t have a style set for it you’ll get a white rectangle or box.
A solution is to either to call
SetStyle("Button")
to get the parent’s style, or to define a style called “MyButton” in the xml and customize it
Also, in the
RegisterObject()
method (if you made one) calling
URHO3D_COPY_BASE_ATTRIBUTES(ParentClassName)
after registering it is important to make sure the editor knows how to handle it.
EDIT: wtf I just want to talk about UI