texture.pixelWidth

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

Overview

This read-only property indicates the horizontal pixel dimensions of the texture that the canvas resource is rendered to.

Creating textures with low pixelWidth and pixelHeight like 32 or 64 can create nice pixelated effects. To make pixel edges sharp, use display.setDefault( "magTextureFilter", "nearest" ) before creating the texture.