texture.height

Type Number
Object TextureResourceCanvas
Library graphics.*
Revision Release 2022.3683
See also TextureResource
TextureResourceCanvas
texture.width
texture.pixelHeight

Overview

This property indicates the height in which objects can be rendered within a TextureResourceCanvas. Essentially, if a display object drawn to the canvas is equal to this height, it will occupy the entire vertical space.

Unlike pixelHeight, this property is not read-only. The visual effect of changing it will be vertical stretching or shrinking of rendered TextureResourceCanvas content. To see the changes, call texture:invalidate().

Gotchas

The default center of the canvas is 0, so the coordinates of the top and bottom edges will be -texture.height/2 and texture.height/2 respectively. This can be altered by changing texture.anchorY.