NoveltyML reference > Objects > Button

<Button>
Inherits from <Object>.

A Button works just like a Group, only there are four fixed states; "Default", "Hover", "Pressed" and "Disabled".

Attribute Description Type
enabled Is button enabled? Boolean

Remarks: Any children to Button will be rendered for all states.


<Default>, <Hover>, <Pressed>, <Disabled>
Button state containers.

Attribute Description Type
name [Required] Unique name for this state String

Child tags Description Count
<Object> Other objects 0 or more


Inherited from <Object>

Attribute Description Type
name [Required] Unique name for this object String
position Position ("x,y") Vector2
pivot Pivot point ("x,y") Vector2
rotation Rotation in radians Float
scale Scale multiplier Float
size Size ("width, height") Vector2
visible Visibility Boolean
rgb Color ("red, green, blue") Vector3
opacity Opacity Float
blending Blending mode Integer
auto-size Automatic sizing based on parent's size ("width%, height%") Vector2
auto-position Automatic position based on parent's size ("x%, y%") Vector2
pixelated Disable linear interpolation of texture Boolean

Remarks: auto-position and auto-size overrides position and size respectively.

Child tags Description Count
<Behaviour> Object behaviours 0 or more
<Meta> Meta information
1
<Object> Other objects 0 or more


NoveltyML sample
<Button name="My button" size="100,50" >
	<Default>
		<Text name="My text" font="My font" text="Default" />
	</Default>
	<Hover>
		<Text name="My text" font="My font" text="Hover" />
	</Hover>
	<Pressed>
		<Text name="My text" font="My font" text="Pressed" />
	</Pressed>
	<Disabled>
		<Text name="My text" font="My font" text="Disabled" />
	</Disabled>
</Button>
		


Back to top