Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
|
Methods
-
adds a canvas rendering
Name Type Description name
string of rendering
draw
function function(context) - use the context to draw within the bounds of the measure function
measure
function function(context) - needs to return {width: width, height: height} for the rendering
params
object object to pass the draw() and measure() functions
Returns:
Type Description object rendersheet object for texture -
adds a data source (e.g., a PNG file in data format)
Name Type Default Description data
object of rendering (not filename)
header
string data:image/png;base64, optional for data
Returns:
Type Description object rendersheet object for texture -
adds an image rendering
Name Type Description name
string of rendering
src
string for image
Returns:
Type Description object rendersheet object for texture -
create (or refresh) the rendersheet (supports async instead of callback)
Name Type Description skipTextures
boolean don't create PIXI.BaseTextures and PIXI.Textures (useful for generating external spritesheets)
-
Changes the drawing function of a texture NOTE: this only works if the texture remains the same size; use Sheet.render() to resize the texture
Name Type Description name
string draw
function -
checks if all textures are loaded
Returns:
Type Description boolean -
removes all textures from rendersheets
-
prints statistics of canvases to console.log
-
Returns:
Type Description number amount of textures in this rendersheet -
tests whether a texture exists
Name Type Description name
string of texture
Returns:
Type Description boolean -
alias for getSprite()
Name Type Description name
string of texture
Returns:
Type Description PIXI.Sprite -
find the index of the texture based on the texture object
Name Type Description find
number this indexed texture
Returns:
Type Description PIXI.Texture -
returns a PIXI.Sprite (with anchor set to 0.5, because that's where it should be)
Name Type Description name
string of texture
Returns:
Type Description PIXI.Sprite -
Name Type Description name
string of texture
Returns:
Type Description PIXI.Texture | null -
create (or refresh) the rendersheet
Name Type Description skipTextures
boolean don't create PIXI.BaseTextures and PIXI.Textures (useful for generating external spritesheets)
callback
function convenience function that calls RenderSheet.once('render', callback)