Novelty scripting reference > Types > Image

Image

Image is a sub-class of Object and shares all of its members and methods.
Image is a reference type. This means it has no constructor and can only be passed around by handle (Image@).

Object types that can be cast as Image: <Border>, <Canvas>, <CanvasSet>, <Gradient>, <Image>, <Video>


Members

bool flip (Property)
Flip texture.

bool mirror (Property)
Mirror texture.


Methods

string GetTexture() const
Returns the name of the image's texture asset.

bool SetTexture(const string &in assetName)
Changes the texture asset. Returns true if successful.
This method won't work for image types with internal textures: Canvas, CanvasSet, Video.

Vector4 GetClipping() const
Returns the image clipping (x, y, width, height).

void SetClipping(const Vector4 &in clippingRect)
Changes the image clipping (x, y, width, height).

string GetShape() const
Returns the name of the image's shape asset.

bool SetShape(const string &in assetName)
Changes the shape asset. Returns true if successful.

Vector2 GetTiling() const
Returns the image tiling (x, y).

void SetTiling(float x, float y)
void SetTiling(const Vector2 &in tiling)
Changes the image tiling (x, y).

Mask@ GetMask() const
Returns a handle to the image's mask.

bool HasMask() const
Returns true if the image has a mask.

void EnumerateAnimations(array<string> &inout objectArray) const
Populates array with all animation sequence names for this image.

uint GetAnimationCount() const
Returns the number of animation sequences for this image.

bool ChangeAnimation(const string &in sequenceName)
Changes the current animation sequence. Returns true if successful.


Sample

// Casting an Object handle to an Image handle
Image@ image = Scene.GetObject("An image object") as Image;

Back to top