<Canvas>
A canvas object.
Draws its children to an internal texture and draws itself as an Image using that texture.
Works just as an Image, except it has its own internal texture.
Because canvases render to an internal texture you need to specify a canvas-size. If not then Novelty will use the value of the size-attribute. If both attributes are undefined it will calculate a size based on the contents.
Remarks: The actual dimensions of the internal texture is determined by the graphics hardware so a canvas may render differently on different computers. In any case, Novelty will use the optimal texture resolution and downscale if necessary.
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.
Example:
canvas-size = "320,240"
Valid child tags
Child tags | Description |
<Traits> | Object traits list |
<Meta> | Meta information |
Objects... | Other objects |
Valid meta class values
Class | Description |
"actor" | Hint to editor that this object is a character/actor. |
Example
<Canvas name="My canvas" canvas-size="auto" >
<Image texture="My texture" />
<Border texture="My other texture" />
</Canvas>