Novelty object reference > SmartCanvas

  SmartCanvas

SmartCanvas object will render its content onto an internal texture and display it like an Image, but unlike a Canvas it will only do so when necessary. If possible it will simply clip content outside of the SmartCanvas' rectangular region instead.

This behavior removes the inherent constraints from using an internal texture and the content can scale without fidelity loss.

In most cases, SmartCanvas is the recommended choice over Canvas.


Usage

Example use cases:


Caveats

SmartCanvas with automatically calculate the internal texture's size based on the absolute scale of the object at the moment it is created. This means it will get as many pixels it need to look nice. Smaller objects mean less pixels.

On some hardware textures will get resized to increments of powers of two (256, 512, ...). This will create blank areas that only appears when the SmartCanvas is tiled.

SmartCanvas will drop its internal texture if it finds itself in a state where one isn't required any more; and it returns to normal rendering.


Related articles


Sample NoveltyML

<SmartCanvas name="My canvas" size="300,300" >
	<Image texture="My texture" />
	<Border texture="My other texture" />
</SmartCanvas>


Back to top