NoveltyML reference > Objects > Set

<Set>

A set is an object that behaves like a Canvas, but can have multiple states which can be switched inside the game. Like a Canvas, it has an internal texture and therefor requires you to specify a canvas-size.

Sets are useful for creating character objects where each state displays a different mood or animation. Child obejcts to a Set (not inside a State) will be rendered for all states.


Set attributes

Attribute Description
canvas-size Dimensions of the internal texture
state Default state ("State name")
transition Transition effect
mirror Flip image horizontally
flip Flip image vertically
shape Custom shape

Additionally, this asset type inherits all object attributes.


canvas-size [vector2]

Size of canvas (internal texture). By default, the canvas' size is used.
By setting canvas-size to "auto" the canvas-size will be determined by the first child object with a valid size.

The maximum canvas size is 2048 x 2048 pixels.

Example:
canvas-size = "320,240"


state [string]

Default state name (must be valid).

Example:
state = "Default"


transition [integer]

Integer value corresponding to the transition mode.
Value Transition
0 None
1 Fast
2 Slow
3 Slower
4 Slowest

Example:
transition = "1"


mirror [bool]

Set to true to horizontally reverse texture.

Example:
mirror = "true"


flip [bool]

Set to true to vertically reverse texture.

Example:
flip = "true"


shape [string]

Name of a valid shape resource.

Example:
shape = "My shape"


Valid child tags

Child tags Description
<State> State container
<Mask> Mask texture
<Traits> Object traits list
<Meta> Meta information
Objects... Other objects


<State>

State container.

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

Child tags Description Count
Objects... Other objects 0 or more


<Mask>

Applies a mask to the Set

Attribute Description Type
texture [Required] Name of a texture resource String
rect Masked region ("x, y, width, height") Vector4


Example

<Set name="My set" size="640,480" >
	<State name="Happy">
		<Image texture="Happy face" />
	</State>
	<State name="Sad">
		<Image texture="Sad face" />
	</State>
</Set>

Back to top