Class TexturePacker
Hierarchy
- TexturePacker
Index
Constructors
constructor
Initializes a texture package series from an array of meshes or a single mesh.
Parameters
name: string
The name of the package
meshes: AbstractMesh[]
The target meshes to compose the package from
options: ITexturePackerOptions
The arguments that texture packer should follow while building.
scene: Scene
The scene which the textures are scoped to.
Returns TexturePacker
TexturePacker
Properties
framesSearch playground for frames
The Container array for the frames that are generated
meshesSearch playground for meshes
The Meshes to target
nameSearch playground for name
The Name of the Texture Package
optionsSearch playground for options
Arguments passed with the Constructor
promiseSearch playground for promise
The promise that is started upon initialization
sceneSearch playground for scene
The scene scope of the TexturePacker
setsSearch playground for sets
The Container object for the channel sets that are generated
Static Readonly LAYOUT_ COLNUMSearch playground for LAYOUT_COLNUM
Packer Layout Constant 2
Static Readonly LAYOUT_ POWER2Search playground for LAYOUT_POWER2
Packer Layout Constant 1
Static Readonly LAYOUT_ STRIPSearch playground for LAYOUT_STRIP
Packer Layout Constant 0
Static Readonly SUBUV_ COLORSearch playground for SUBUV_COLOR
Packer Layout Constant 2
Static Readonly SUBUV_ EXTENDSearch playground for SUBUV_EXTEND
Packer Layout Constant 1
Static Readonly SUBUV_ WRAPSearch playground for SUBUV_WRAP
Packer Layout Constant 0
Methods
disposeSearch playground for dispose
Disposes all textures associated with this packer
Returns void
downloadSearch playground for download
Starts the download process for all the channels converting them to base64 data and embedding it all in a JSON file.
Parameters
Optional imageType: string
is the image type to use.
Optional quality: number
of the image if downloading as jpeg, Ranges from >0 to 1.
Returns void
process Async
Starts the async promise to compile the texture packer.
Returns Promise<void>
Promiseset Mesh To FrameSearch playground for setMeshToFrame
Public method to set a Mesh to a frame
Parameters
m: AbstractMesh
that is the target
frameID: number
or the frame index
Optional updateMaterial: boolean
trigger for if the Meshes attached Material be updated?
Returns void
update FromJSONSearch playground for updateFromJSON
Public method to load a texturePacker JSON file.
Parameters
data: string
of the JSON file in string format.
Returns void
This is a support class that generates a series of packed texture sets.
https://doc.babylonjs.com/babylon101/materials