23 | | <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> |
24 | | |
25 | | <!DOCTYPE styles SYSTEM "../gui.dtd"> |
26 | | |
27 | | <styles> |
28 | | <!-- Style that will hide the object as new default --> |
29 | | <style name="style_name1" |
30 | | hidden="true" |
31 | | /> |
32 | | |
33 | | <!-- Style that helps us create a nice edit box --> |
34 | | <style name="editbox_nice" |
35 | | sprite="sprite1" |
36 | | font="font1" |
37 | | /> |
38 | | </styles> |
| 22 | #!xml |
| 23 | <?xml version="1.0" encoding="utf-8"?> |
| 24 | |
| 25 | <styles> |
| 26 | <!-- This style will hide the object it's used by --> |
| 27 | <style name="style_name1" |
| 28 | hidden="true" |
| 29 | /> |
| 30 | |
| 31 | <!-- This style provides styling to create a nice-looking edit box. --> |
| 32 | <style name="editbox_nice" |
| 33 | sprite="sprite1" |
| 34 | font="font1" |
| 35 | /> |
| 36 | </styles> |
47 | | <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> |
48 | | |
49 | | <!DOCTYPE sprites SYSTEM "../gui.dtd"> |
50 | | |
51 | | <sprites> |
52 | | <!-- Here's a sprite with two images next to each other --> |
53 | | <sprite name="sprite1"> |
54 | | <image texture="texture1.jpg" |
55 | | size="0 0 50% 100%" |
56 | | texture_size="0 0 20 20" |
57 | | /> |
58 | | <image texture="texture2.jpg" |
59 | | size="50% 0 100% 100%" |
60 | | texture_size="0 0 20 20" |
61 | | /> |
62 | | </sprite> |
63 | | |
64 | | <!-- Here's a simple sprite that is just one image stretched to fit the whole area --> |
65 | | <sprite name="sprite2"> |
66 | | <image texture="texture1.jpg" |
67 | | size="0 0 100% 100%" |
68 | | texture_size="0 0 100% 100%" |
69 | | /> |
70 | | </sprite> |
71 | | </sprites> |
| 45 | #!xml |
| 46 | <?xml version="1.0" encoding="utf-8"?> |
| 47 | |
| 48 | <sprites> |
| 49 | <!-- Here's a sprite with two images next to each other --> |
| 50 | <sprite name="sprite1"> |
| 51 | <image texture="texture1.jpg" |
| 52 | size="0 0 50% 100%" |
| 53 | texture_size="0 0 20 20" |
| 54 | /> |
| 55 | <image texture="texture2.jpg" |
| 56 | size="50% 0 100% 100%" |
| 57 | texture_size="0 0 20 20" |
| 58 | /> |
| 59 | </sprite> |
| 60 | |
| 61 | <!-- Here's a simple sprite that is just one image stretched to fit the whole area --> |
| 62 | <sprite name="sprite2"> |
| 63 | <image texture="texture1.jpg" |
| 64 | size="0 0 100% 100%" |
| 65 | texture_size="0 0 100% 100%" |
| 66 | /> |
| 67 | </sprite> |
| 68 | </sprites> |
80 | | <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> |
81 | | |
82 | | <!DOCTYPE setup SYSTEM "../gui.dtd"> |
83 | | |
84 | | <setup> |
85 | | <scrollbar name="sb" |
86 | | width="18" |
87 | | minimum_bar_size="5" |
88 | | sprite_button_top="sprite2" |
89 | | sprite_button_top_over="null" |
90 | | sprite_button_bottom="sprite2" |
91 | | sprite_button_bottom_over="null" |
92 | | sprite_back_vertical="grey" |
93 | | sprite_bar_vertical="sprite2" |
94 | | sprite_bar_vertical_over="null" |
95 | | sprite_bar_vertical_pressed="null" |
96 | | sprite_button_bottom_pressed="sprite2_pressed" |
97 | | sprite_button_top_pressed="sprite2_pressed" |
98 | | /> |
99 | | |
100 | | <icon name="0ad_icon" |
101 | | texture="0ad_icon" |
102 | | size="16 16" |
103 | | /> |
104 | | |
105 | | <tooltip name="pregame_mainmenu_tooltip" |
106 | | use_object="pregame_mainmenu_tooltip" |
107 | | delay="0" |
108 | | hide_object="true" |
109 | | /> |
110 | | </setup> |
| 77 | #!xml |
| 78 | <?xml version="1.0" encoding="utf-8"?> |
| 79 | |
| 80 | <setup> |
| 81 | <scrollbar name="sb" |
| 82 | width="18" |
| 83 | minimum_bar_size="5" |
| 84 | sprite_button_top="sprite2" |
| 85 | sprite_button_top_over="null" |
| 86 | sprite_button_bottom="sprite2" |
| 87 | sprite_button_bottom_over="null" |
| 88 | sprite_back_vertical="grey" |
| 89 | sprite_bar_vertical="sprite2" |
| 90 | sprite_bar_vertical_over="null" |
| 91 | sprite_bar_vertical_pressed="null" |
| 92 | sprite_button_bottom_pressed="sprite2_pressed" |
| 93 | sprite_button_top_pressed="sprite2_pressed" |
| 94 | /> |
| 95 | |
| 96 | <icon name="0ad_icon" |
| 97 | texture="0ad_icon" |
| 98 | size="16 16" |
| 99 | /> |
| 100 | |
| 101 | <tooltip name="pregame_mainmenu_tooltip" |
| 102 | use_object="pregame_mainmenu_tooltip" |
| 103 | delay="0" |
| 104 | hide_object="true" |
| 105 | /> |
| 106 | </setup> |
121 | | <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> |
122 | | |
123 | | <!DOCTYPE objects SYSTEM "../gui.dtd"> |
124 | | |
125 | | <objects> |
126 | | <object name="object_name" |
127 | | type="button" |
128 | | size="50%+2 50%+5 50%+10 50%+10" |
129 | | hotkey="example_button.toggle" |
130 | | sprite="example_button" |
131 | | sprite_pressed="example_button_pressed" |
132 | | >This is the button's caption. |
133 | | <action on="Press"><![CDATA[ |
134 | | DoSomething(); |
135 | | ]]></action> |
136 | | |
137 | | <!-- Example child objects --> |
138 | | <object name="child1" |
139 | | type="text" |
140 | | /> |
141 | | <object name="child2" |
142 | | type="image" |
143 | | /> |
144 | | </object> |
145 | | </objects> |
| 117 | #!xml |
| 118 | <?xml version="1.0" encoding="utf-8"?> |
| 119 | |
| 120 | <objects> |
| 121 | <object name="object_name" |
| 122 | type="button" |
| 123 | size="50%+2 50%+5 50%+10 50%+10" |
| 124 | hotkey="example_button.toggle" |
| 125 | sprite="example_button" |
| 126 | sprite_pressed="example_button_pressed" |
| 127 | > |
| 128 | This is the button's caption. |
| 129 | |
| 130 | <!-- Example child objects --> |
| 131 | <object name="child1" |
| 132 | type="text" |
| 133 | /> |
| 134 | <object name="child2" |
| 135 | type="image" |
| 136 | /> |
| 137 | </object> |
| 138 | </objects> |
148 | | The GUI defined above has got one uppermost object, or '''root object''' (i.e. it is parentless as it is placed within the <objects> tag, and not another object), and it has got two children objects and one [wiki:GUI_-_Actions action] assigned to it. Objects can have any number of children, and they are placed anywhere within the parent. You can have as many root objects in one file as you like, just place them next to each other. Within the object tag you define its [wiki:GUI_-_Properties properties] as shown above. If an object has got a caption, it should be placed just after the opening tag, and |
149 | | before any other sub-elements. Read more about actions [wiki:GUI_-_Actions here]. |
| 141 | The GUI defined above has got one uppermost object, or ''root object'' (i.e. it is parentless as it is bounded by the `<objects>` start and end tags, and not another `<object>`), and it has two child objects. |
| 142 | |
| 143 | An object may have any number of children, placed anywhere within the parent. You may have more than one ''root object'' in a single file: just place them next to each other within the bounds of the `<objects>` tag. |
| 144 | |
| 145 | Within the `<object>` tag you define its [wiki:GUI_-_Properties properties] as shown above. If an object has a caption, it should be placed just after the opening tag, and |
| 146 | before any other sub-elements. |