Interface: TextureOptions

TextureOptions

The options that can be passed to a new Texture

Properties:
Name Type Description
defaultAnchor {
   x: number,
   y: number
}

Default anchor point used for sprite placement / rotation

defaultBorders TextureBorders

Default borders used for 9-slice scaling NineSlicePlane

dynamic boolean

Set to true if you plan on modifying this texture's frame, UVs, or swapping its source at runtime. This is false by default as it improves performance. Generally, it's recommended to create new textures and swap those rather than modifying an existing texture's properties unless you are working with a dynamic frames. Not setting this to true when modifying the texture can lead to visual artifacts.

If this is false and you modify the texture, you can manually update the sprite's texture by calling sprite.onViewUpdate().

frame Rectangle

The rectangle frame of the texture to show

label string

optional label, for debugging

orig Rectangle

The area of original texture

rotate number

indicates how the texture was rotated by texture packer. See groupD8

source TextureSourceType

the underlying texture data that this texture will use

trim Rectangle

Trimmed rectangle of original texture

Members

defaultAnchor {
   x: number,
   y: number
}

Default anchor point used for sprite placement / rotation

defaultBorders TextureBorders

Default borders used for 9-slice scaling NineSlicePlane

dynamic boolean

Set to true if you plan on modifying this texture's frame, UVs, or swapping its source at runtime. This is false by default as it improves performance. Generally, it's recommended to create new textures and swap those rather than modifying an existing texture's properties unless you are working with a dynamic frames. Not setting this to true when modifying the texture can lead to visual artifacts.

If this is false and you modify the texture, you can manually update the sprite's texture by calling sprite.onViewUpdate().

frame Rectangle

The rectangle frame of the texture to show

label string

optional label, for debugging

orig Rectangle

The area of original texture

rotate number

indicates how the texture was rotated by texture packer. See groupD8

source TextureSourceType

the underlying texture data that this texture will use

trim Rectangle

Trimmed rectangle of original texture