Interface: ImportTextureOptions
Defined in: rendering/utilities/import-texture.ts:5
Fields of ImportedTexture with a sensible default; callers may omit these.
Extended by
Properties
height
height:
number
Defined in: rendering/utilities/import-texture.ts:28
The texture's pixel height to import. Defaults to image.height.
pixelsPerUnit
pixelsPerUnit:
number
Defined in: rendering/utilities/import-texture.ts:15
How many pixels of the texture span one world unit, mirroring a texture
asset's "Pixels Per Unit" import setting in engines like Unity. The
resulting worldWidth/worldHeight are width / pixelsPerUnit and
height / pixelsPerUnit. This is independent of calculatePixelsPerUnit,
which converts world units to screen pixels at render time based on
the camera; pixelsPerUnit here converts texture pixels to world
units once, at import time. Defaults to 100.
width
width:
number
Defined in: rendering/utilities/import-texture.ts:23
The texture's pixel width to import. Defaults to image.width;
override for a texture whose usable pixel width differs from the
source image, for example a single frame trimmed out of a larger
sprite sheet.