Repository navigation
UiElements XML
This documentation is for 1.4.0 or above. For 1.3.x, see here
The following shows all XML tags available for UiElements. For information on how to load/save UiElements with XML see the UiElements page.
The following tags are available in every UiElement.
<!-- Sets the visibility: HIDDEN, VISIBLE, NO_RENDER --->
<visibility>HIDDEN</visibility>
<!-- Sets the theme style id -->
<styleId>default</styleId>
<!-- Sets the layer to render the element on -->
<zIndex>0<zIndex> For any ParentUiElement implementation the following tags are also available in addition to the above common tags.
<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>
<!-- (OPTIONAL) Set the layout order of child elements. Can be COLUMN or COLUMN_REVERSE -->
<flexDirection>COLUMN</flexDirection>
<!-- (OPTIONAL) Sets the child elements of the element -->
<children length="1">
<value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
<!-- element content here-->
</value>
</children>AbsoluteContainer is an implementation of ParentUiElement.
<!-- (OPTIONAL) Sets x pixel coordinate of the AbsoluteContainer -->
<x>0</x>
<!-- (OPTIONAL) Sets y pixel coordinate of the AbsoluteContainer -->
<y>0</y>AbsoluteModal is an implementation of ParentUiElement.
<!-- (OPTIONAL) Sets x pixel coordinate of the AbsoluteModal-->
<x>0</x>
<!-- (OPTIONAL) Sets y pixel coordinate of the AbsoluteModal-->
<y>0</y>AlignedContainer is an implementation of ParentUiElement.
<!-- (OPTIONAL) Sets the vertical alignment of the AlignedContainer; TOP, BOTTOM or MIDDLE -->
<verticalAlignment>MIDDLE</verticalAlignment>
<!-- (OPTIONAL) Sets the horizontal alignment of the AlignedContainer; LEFT, RIGHT or CENTER -->
<horizontalAlignment>CENTER</horizontalAlignment>AlignedModal is an implementation of ParentUiElement.
<!-- (OPTIONAL) Sets the vertical alignment of the AlignedModal; TOP, BOTTOM or MIDDLE -->
<verticalAlignment>MIDDLE</verticalAlignment>
<!-- (OPTIONAL) Sets the horizontal alignment of the AlignedModal; LEFT, RIGHT or CENTER -->
<horizontalAlignment>CENTER</horizontalAlignment>Column is the default implementation of ParentUiElement.
Button is an implementation of ParentUiElement.
<!-- (OPTIONAL) Sets if the button is enabled -->
<enabled>true</enabled><!-- (REQUIRED) The texture to fetch from the AssetManager, or if using an atlas, the atlas name to lookup -->
<texturePath>example.png</texturePath>
<!-- (OPTIONAL) The name of the atlas to fetch from the AssetManager -->
<atlas>example.atlas</atlas>
<!-- (OPTIONAL) True if the image should scale proportionally to fill the parent's width -->
<responsive>true</responsive>
<!-- (OPTIONAL) True if the texture should rendered flipped horizontally -->
<flipX>false</flipX>
<!-- (OPTIONAL) True if the texture should rendered flipped vertically -->
<flipY>false</flipY>ImageButton is a utility implementation of Button and has the same XML properties. Requires an Image child element.
<!-- (OPTIONAL) The text of the label -->
<text>Hello, world!</text>
<!-- (OPTIONAL) The horizontal alignment of the text; LEFT, CENTER or RIGHT -->
<horizontalAlignment>LEFT</horizontalAlignment>
<!-- (OPTIONAL) True if the width of the label should fill the parent's width, false if the width should match the text width -->
<responsive>true</responsive>
<!-- (OPTIONAL) The TextAnimation to use for rendering -->
<textAnimation></textAnimation><!-- (OPTIONAL) Sets minimum value; defaults to 0 -->
<min>0</min>
<!-- (OPTIONAL) Sets maximum value; defaults to 100 -->
<max>100</max>
<!-- (OPTIONAL) Sets the progress bar's current value, defaults to 0 -->
<value>0</value>
<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>Row a child class of Column and has the same XML properties.
ScrollBox is an implementation of ParentUiElement.
<!-- (OPTIONAL) The scroll speed with the scroll up/down buttons are clicked -->
<scrollFactor>0.005</scrollFactor>
<!-- (OPTIONAL) The max height of the ScrollBox in pixels -->
<maxHeight>192</maxHeight><!-- (OPTIONAL) Sets the tabs elements of the TabView -->
<tabs length="1">
<value class="org.mini2Dx.ui.element.Tab" id="tabIdHere">
<!-- tab content here-->
</value>
</tabs>
<!-- (OPTIONAL) Sets layout rules for the tab buttons -->
<tabButtonLayout>xs-12c</tabButtonLayout>Tab is an implementation of ParentUiElement.
<!-- (OPTIONAL) The name to display for the tab -->
<title>Tab 1</title>
<!-- (OPTIONAL) The icon to display for the tab -->
<iconPath>texture.png</iconPath><!-- (OPTIONAL) Sets if the textbox is enabled -->
<enabled>true</enabled>
<!-- (OPTIONAL) True if the text should be masked with * characters during rendering -->
<passwordField>false</passwordField>
<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>TextButton is a utility implementation of Button and has the same XML properties. Requires a Label child element.
Getting Started
Graphics
Gameplay
Data
- Asset Management
- Saving and loading player data
- Converting objects to/from JSON
- Converting objects to/from XML
User Interfaces / HUDs
Structuring your code
Releasing your game