There are five XML files in total: animation. XML (not explained at the moment)
Dialog. xml
Stringtable. xml
Style. xml
Testbutton. xml
Style reference. The content and relationship referenced by stringtable are roughly as follows:
1 < Panel Name = "Testbutton" Pos = "5,-105,-5,-5" Style = "Panel" > 2 < Button Name = "Colorbtn1" Pos = "5, 4, 45, 35" Txt = "Str | colorbtn1" Style = "Btncolor1" /> 3 < Button Name = "Colorbtn2" Pos = "50, 4, 90, 35" Txt = "Str | colorbtn2" Style = "Btncolor2" /> 4 < Button Name = "Imgbtn1" Pos = ", 5" Txt = "Str | imgbtn1" Style = "Btnimg1" /> 5 < Button Name = "Imgbtn2" Pos = "155, 265, 45" Txt = "Str | imgbtn2" Style = "Btnimg2" /> 6 < Button Name = "Imgbtn3" Pos = ", 5" Txt = "Str | imgbtn3" Style = "Btnimg3" /> 7 </ Panel >
AboveCodeObviously, the descriptions of a button are much less, and the content described by the style attribute is in style. xml;
1 < Style Name = "Panel" > 2 < ATT Name = "Bgmode" Value = "2" /> 3 < ATT Name = "Bgimg" Value = "Panelbg.png" /> 4 < ATT Name = "Bgstretch" Value = "5, 5, 5" /> 5 < ATT Name = "Fcolor" Value = "Ff000000" /> 6 </ Style > 7 < Style Name = "Btncolor1" > 8 < ATT Name = "Bgmode" Value = "0" /> 9 < ATT Name = "Bgcolor" Value = "Ffff0000" /> 10 < ATT Name = "Bghovercolor" Value = "Ff00ff00" /> 11 </ Style > 12 < Style Name = "Btncolor2" Inherit = "Btncolor1" > <! -- Note that it can be inherited --> 13 < ATT Name = "Disable" Value = "1" /> 14 </ Style > 15 < Style Name = "Btnimg1" > 16 < ATT Name = "Fcolor" Value = "Ff00ff00" /> 17 < ATT Name = "Bgmode" Value = "1" /> 18 < ATT Name = "Bgimg" Value = "Btnbg.png" /> 19 </ Style > 20 < Style Name = "Btnimg2" > 21 < ATT Name = "Fcolor" Value = "Ff00ff00" /> 22 < ATT Name = "Bgmode" Value = "2" /> 23 < ATT Name = "Bgimg" Value = "Btnbg.png" /> 24 < ATT Name = "Bgstretch" Value = "5, 5, 5" /> 25 </ Style > 26 < Style Name = "Btnimg3" Inherit = "Btnimg2" > 27 < ATT Name = "Disable" Value = "1" /> 28 </ Style >
Note: The attribute content of the style supports inheritance, which can reduce the amount of XML and increase the resolution speed;
In addition, the text on the button:
TXT = "str | imgbtn3"
Supports indexing from stringtable. "str |" is a keyword, indicating a problem in the index character list. You can also enter the text directly;
In this way, the xml configuration is basically ready;
The following plan is to begin the design of skin changing, color changing, and text changing functions (these are basic support frameworks and need to be prepared before the mass write controls are started, otherwise, the system will not be able to lag behind the scenes );