Skip to content

UiElements XML 1.3.0

Thomas Cashman edited this page Jan 17, 2017 · 3 revisions

This documentation is for 1.3.x

The following shows all XML tags available for UiElements. For information on how to load/save UiElements with XML see the UiElements page.

Common in all elements

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> 

AbsoluteContainer

<!-- (OPTIONAL) Sets x pixel coordinate of the AbsoluteContainer -->
<x>0</x>

<!-- (OPTIONAL) Sets y pixel coordinate of the AbsoluteContainer -->
<y>0</y>

<!-- (OPTIONAL) Sets the child elements of the AbsoluteContainer -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

AbsoluteModal

<!-- (OPTIONAL) Sets x pixel coordinate of the AbsoluteModal-->
<x>0</x>

<!-- (OPTIONAL) Sets y pixel coordinate of the AbsoluteModal-->
<y>0</y>

<!-- (OPTIONAL) Sets the child elements of the AbsoluteModal -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

AlignedContainer

<!-- (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>

<!-- (OPTIONAL) Sets the child elements of the AlignedContainer -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

AlignedModal

<!-- (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>

<!-- (OPTIONAL) Sets the child elements of the AlignedModal -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

Column

<!-- (OPTIONAL) Sets the child elements of the column -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

ContentButton

<!-- (OPTIONAL) Sets the child elements of the ContentButton -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (OPTIONAL) Sets if the button is enabled -->
<enabled>true</enabled>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

Image

<!-- (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

<!-- (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) Sets if the button is enabled -->
<enabled>true</enabled>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

Label

<!-- (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>

ProgressBar

<!-- (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

<!-- (OPTIONAL) Sets the child elements of the row -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

ScrollBox

<!-- (OPTIONAL) Sets the child elements of the ScrollBox -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

<!-- (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 layout rules -->
<layout>xs-12c</layout>

Tab

<!-- (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 the child elements of the tab -->
<children length="1">
    <value class="org.mini2Dx.ui.element.TextButton" id="elementIdHere">
        <!-- element content here-->
    </value>
</children>

TabView

<!-- (OPTIONAL) Sets the child elements of the column -->
<tabs length="1">
    <value class="org.mini2Dx.ui.element.Tab" id="tabIdHere">
        <!-- tab content here-->
    </value>
</tabs>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

<!-- (OPTIONAL) Sets layout rules for the tab buttons -->
<tabButtonLayout>xs-12c</tabButtonLayout>

TextBox

<!-- (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

<!-- (OPTIONAL) Sets the text of the button -->
<text>Click me</text>

<!-- (OPTIONAL) Sets the alignment of the text within the button; LEFT, RIGHT or CENTER -->
<textAlignment>CENTER</textAlignment>

<!-- (OPTIONAL) Sets if the button is enabled -->
<enabled>true</enabled>

<!-- (OPTIONAL) Sets layout rules -->
<layout>xs-12c</layout>

Clone this wiki locally