@tawaship/pixim-animate-runtime - v0.1.0
    Preparing search index...

    Class GradientTexture

    A gradient drawn into a canvas by the browser's own gradient (so its colors are what canvas, and createjs, paints), as a texture that Pixi's Graphics fills and strokes with through a matrix. gradient is the gradient in the shape's coordinates, local the same gradient in the texture's pixels, and toShape takes texture pixels to the shape's coordinates. Outside the drawn area the texture's edge pixels repeat (Pixi clamps), which is how canvas pads a gradient with its end colors.

    Hierarchy

    Index
    _frame: Rectangle

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    PIXI.Texture#_frame

    _updateID: number

    Update ID is observed by sprites and TextureMatrix instances. Call updateUvs() to increment it.

    PIXI.Texture#_updateID

    The WebGL UV data cache. Can be used as quad UV

    PIXI.Texture#_uvs

    baseTexture: BaseTexture

    The base texture that this texture uses.

    PIXI.Texture#baseTexture

    defaultAnchor: Point

    Anchor point that is used as default if sprite is created with this texture. Changing the defaultAnchor at a later point of time will not update Sprite's anchor point.

    PIXI.Texture#defaultAnchor

    {0,0}
    
    frame: Rectangle

    The frame specifies the region of the base texture that this texture uses. Please call updateUvs() after you change coordinates of frame manually.

    gradient: IGradient
    height: number

    The height of the Texture in pixels.

    local: IGradient
    noFrame: boolean

    Does this Texture have any frame data assigned to it?

    This mode is enabled automatically if no frame was passed inside constructor.

    In this mode texture is subscribed to baseTexture events, and fires update on any change.

    Beware, after loading or resize of baseTexture event can fired two times! If you want more control, subscribe on baseTexture itself.

    texture.on('update', () => {});
    

    Any assignment of frame switches off noFrame mode.

    PIXI.Texture#noFrame

    orig: Rectangle

    This is the area of original texture, before it was put in atlas

    PIXI.Texture#orig

    resolution: number

    Returns resolution of baseTexture

    rotate: number

    Indicates whether the texture is rotated inside the atlas set to 2 to compensate for texture packer rotation set to 6 to compensate for spine packer rotation can be used to rotate or mirror sprites See PIXI.groupD8 for explanation

    textureCacheIds: string[]

    The ids under which this Texture has been added to the texture cache. This is automatically set as long as Texture.addToCache is used, but may not be set if a Texture is added directly to the TextureCache array.

    PIXI.Texture#textureCacheIds

    toShape: Matrix
    trim: Rectangle

    This is the trimmed area of original texture, before it was put in atlas Please call updateUvs() after you change coordinates of trim manually.

    PIXI.Texture#trim

    uvMatrix: TextureMatrix

    Default TextureMatrix instance for this texture By default that object is not created because its heavy

    PIXI.Texture#uvMatrix

    valid: boolean

    This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.

    PIXI.Texture#valid

    width: number

    The width of the Texture in pixels.

    EMPTY: Texture

    An empty texture, used often to not have to create multiple empty textures. Can not be destroyed.

    WHITE: Texture

    A white texture of 16x16 size, used for graphics and other things Can not be destroyed.

    • Alias method for on

      Parameters

      • event: string | symbol
      • fn: Function
      • Optionalcontext: any

      Returns this

    • Utility function for BaseTexture|Texture cast

      Returns void

    • Creates a new texture object that acts the same as this one.

      Returns Texture

      The new texture

    • Destroys this texture

      Parameters

      • OptionaldestroyBase: boolean

        Whether to destroy the base texture as well

      Returns void

    • Calls each of the listeners registered for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • ...args: any[]

        Arguments that are passed to registered listeners

      Returns boolean

      true if the event had listeners, else false.

    • Return an array listing the events for which the emitter has registered listeners.

      Returns (string | symbol)[]

    • Return the number of listeners listening to a given event.

      Parameters

      • event: string | symbol

        The event name.

      Returns number

    • Return the listeners registered for a given event.

      Parameters

      • event: string | symbol

        The event name.

      Returns Function[]

    • Alias method for removeListener

      Parameters

      • event: string | symbol
      • Optionalfn: Function
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • fn: Function

        The listener function.

      • Optionalcontext: any

        The context to invoke the listener with.

      Returns this

      this.

    • Protected

      Called when the base texture is updated

      Parameters

      Returns void

    • Add a one-time listener for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • fn: Function

        The listener function.

      • Optionalcontext: any

        The context to invoke the listener with.

      Returns this

      this.

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: string | symbol

        The event name.

      Returns this

      this.

    • Remove the listeners of a given event.

      Parameters

      • event: string | symbol

        The event name.

      • Optionalfn: Function

        Only remove the listeners that match this function.

      • Optionalcontext: any

        Only remove the listeners that have this context.

      • Optionalonce: boolean

        Only remove one-time listeners.

      Returns this

      this.

    • Updates this texture on the gpu.

      Calls the TextureResource update.

      If you adjusted frame manually, please call updateUvs() instead.

      Returns void

    • Updates the internal WebGL UV cache. Use it after you change frame or trim of the texture. Call it after changing the frame

      Returns void

    • Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.

      Parameters

      • texture: Texture

        The Texture to add to the cache.

      • id: string

        The id that the Texture will be stored against.

      Returns void

    • Helper function that creates a new Texture based on the source you provide. The source can be - frame id, image url, video url, canvas element, video element, base texture

      Parameters

      Returns Texture

      The newly created texture

    • Create a new Texture with a BufferResource from a Float32Array. RGBA values are floats from 0 to 1.

      Parameters

      • buffer: Float32Array<ArrayBuffer> | Uint8Array<ArrayBuffer>

        The optional array to use, if no data is provided, a new Float32Array is created.

      • width: number

        Width of the resource

      • height: number

        Height of the resource

      • Optionaloptions: any

        See PIXI.BaseTexture's constructor for options.

      Returns Texture

      The resulting new BaseTexture

    • Create a texture from a source and add to the cache.

      Parameters

      • source: HTMLImageElement | HTMLCanvasElement

        The input source.

      • imageUrl: string

        File name of texture, for cache and resolving resolution.

      • Optionalname: string

        Human readable name for the texture cache. If no name is specified, only imageUrl will be used as the cache ID.

      Returns Texture

      Output texture

    • Useful for loading textures via URLs. Use instead of Texture.from because it does a better job of handling failed URLs more effectively. This also ignores PIXI.settings.STRICT_TEXTURE_CACHE. Works for Videos, SVGs, Images.

      Parameters

      • url: string

        The remote URL to load.

      • Optionaloptions: any

        Optional options to include

      Returns Promise<Texture>

      A Promise that resolves to a Texture.

    • Remove a Texture from the global TextureCache.

      Parameters

      • texture: string | Texture

        id of a Texture to be removed, or a Texture instance itself

      Returns Texture | null

      The Texture that was removed