NoveltyML reference > Objects > Canvas

<Canvas>

A canvas object.
Works just as an Image, except it has its own internal texture. Placing objects inside a canvas will have them render to that texture. Canvases can be used to "flatten" a collection of objects into a single Image.

For a Canvas to render properly you need to specify the size of the canvas using the canvas-size attribute. If no canvas-size is set the size attribute wil be used instead.


Canvas attributes

Attribute Description
canvas-size Dimensions of the internal texture
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"


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
<Traits> Object traits list
<Meta> Meta information
Objects... Other objects


Example

<Canvas name="My canvas" canvas-size="auto" >
	<Image texture="My texture" />
	<Border texture="My other texture" />
</Canvas>

Back to top