Options
All
  • Public
  • Public/Protected
  • All
Menu

An extension of PIXI.Mesh which emulate a PIXI.Sprite with a specific shader.

param Texture

bound to this sprite mesh.

param Shader

class used by this sprite mesh.

Hierarchy

  • any
    • SpriteMesh

Index

Constructors

Properties

_cachedTint: number[]
override
vertexData: any
uvs: any
indices: any
_texture: any
_anchor: any
alpha: number
blendMode: any
_transformID: number = -1
override
_textureID: number = -1
override
_textureTrimmedID: number = -1
override
_transformTrimmedID: number = -1
override
_roundPixels: boolean = false
override
vertexTrimmedData: any = null
override
isSprite: boolean = true
override
_width: any
_height: any
_tint: any
_tintRGB: any
shader: any
geometry: any
_batchData: { _tintRGB: number; _texture: Texture; indices: number[]; uvs: number[]; blendMode: BLEND_MODES; vertexData: number[]; worldAlpha: number } = ...

Snapshot of some parameters of this display object to render in batched mode. TODO: temporary object until the upstream issue is fixed: https://github.com/pixijs/pixijs/issues/8511

Type declaration

  • _tintRGB: number
  • _texture: Texture
  • indices: number[]
  • uvs: number[]
  • blendMode: BLEND_MODES
  • vertexData: number[]
  • worldAlpha: number
#tintAlphaDirty: boolean = true

Used to track a tint or alpha change to execute a recomputation of _cachedTint.

#alphaMode: any = null
#pluginName: any = null
#worldAlpha: any

Accessors

  • get texture(): any
  • set texture(texture: any): void
  • override

    Returns any

  • override

    Parameters

    • texture: any

    Returns void

  • get tint(): any
  • set tint(tint: any): void
  • override

    Returns any

  • override

    Parameters

    • tint: any

    Returns void

  • get alphaMode(): any
  • set alphaMode(mode: any): void
  • Used to force an alpha mode on this sprite mesh. If this property is non null, this value will replace the texture alphaMode when computing color channels. Affects how tint, worldAlpha and alpha are computed each others.

    Returns any

  • Used to force an alpha mode on this sprite mesh. If this property is non null, this value will replace the texture alphaMode when computing color channels. Affects how tint, worldAlpha and alpha are computed each others.

    Parameters

    • mode: any

    Returns void

  • get pluginName(): string
  • set pluginName(name: string): void
  • Returns the SpriteMesh associated batch plugin. By default the returned plugin is that of the associated shader. If a plugin is forced, it will returns the forced plugin.

    Returns string

  • Returns the SpriteMesh associated batch plugin. By default the returned plugin is that of the associated shader. If a plugin is forced, it will returns the forced plugin.

    Parameters

    • name: string

    Returns void

  • get width(): number
  • set width(width: number): void
  • override

    Returns number

  • override

    Parameters

    • width: number

    Returns void

  • get height(): number
  • set height(height: number): void
  • override

    Returns number

  • override

    Parameters

    • height: number

    Returns void

  • get anchor(): any
  • set anchor(anchor: any): void
  • override

    Returns any

  • override

    Parameters

    • anchor: any

    Returns void

  • get sourceElement(): HTMLImageElement | HTMLVideoElement
  • The HTML source element for this SpriteMesh texture.

    Returns HTMLImageElement | HTMLVideoElement

  • get isVideo(): boolean
  • Is this SpriteMesh rendering a video texture?

    Returns boolean

Methods

  • _onTextureUpdate(): void
  • override

    Returns void

  • _onAnchorUpdate(): void
  • override

    Returns void

  • updateUvs(): void
  • Update uvs and push vertices and uv buffers on GPU if necessary.

    Returns void

  • setShaderClass(shaderCls: class): void
  • Initialize shader based on the shader class type.

    Parameters

    • shaderCls: class

      Shader class used. Must inherit from AbstractBaseShader.

    Returns void

  • updateTransform(parentTransform: any): void
  • override

    Parameters

    • parentTransform: any

    Returns void

  • calculateVertices(): void
  • override

    Returns void

  • calculateTrimmedVertices(): any
  • override

    Returns any

  • _render(renderer: any): void
  • override

    Parameters

    • renderer: any

    Returns void

  • _renderToBatch(renderer: any): void
  • override

    Parameters

    • renderer: any

    Returns void

  • _renderDefault(renderer: any): void
  • override

    Parameters

    • renderer: any

    Returns void

  • _calculateBounds(...args: any[]): any
  • override

    Parameters

    • Rest ...args: any[]

    Returns any

  • getLocalBounds(...args: any[]): any
  • override

    Parameters

    • Rest ...args: any[]

    Returns any

  • containsPoint(...args: any[]): any
  • override

    Parameters

    • Rest ...args: any[]

    Returns any

  • destroy(...args: any[]): any
  • override

    Parameters

    • Rest ...args: any[]

    Returns any

  • _updateBatchData(): void
  • Create a SpriteMesh from another source. You can specify texture options and a specific shader class derived from AbstractBaseShader.

    Parameters

    • source: any

      Source to create texture from.

    • textureOptions: any
    • shaderCls: AbstractBaseShader

    Returns SpriteMesh