NoveltyML reference > Objects > CanvasSet

<CanvasSet>

A canvas set object.
A set is an object that can contain multiple states. Only one state is drawn at any one time. The content of the selected state is drawn as a Canvas.

Remarks: If a size or canvas-size isn't specifically specified then one will be calculated based on the content of the first state.

See also: <Set>


Set attributes

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

Additionally, this asset type inherits all object attributes.


canvas-size [vector2]

Size of canvas (internal texture). If omitted the size-attribute will be used.
By setting canvas-size to "auto" the canvas-size will be determined by the first child object with a valid size.

Example:
canvas-size = "320,240"


flip [bool]

Set to true to vertically reverse texture.

Example:
flip = "true"


mirror [bool]

Set to true to horizontally reverse texture.

Example:
mirror = "true"


shape [string]

Name of a valid shape resource.

Example:
shape = "My shape"


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"


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


Valid meta class values

Class Description
"actor" Hint to editor that this object is a character/actor.


Example

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

Back to top