Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

ArrayFixed

ArrayFixed<T, L>: [T, ...T[]] & { length: L }

Type parameters

  • T

  • L: number

Dict

Dict<T>: {}

Type parameters

  • T

Type declaration

  • [key: string]: T

Variables

Const BaseTextureCache

BaseTextureCache: {}
todo

Describe property usage

static
name

BaseTextureCache

memberof

PIXI.utils

Type declaration

Const DATA_URI

DATA_URI: RegExp

Regexp for data URI. Based on: https://github.com/ragingwind/data-uri-regex

static
constant

{RegExp|string} DATA_URI

memberof

PIXI

example

data:image/png;base64

Const ProgramCache

ProgramCache: {}
todo

Describe property usage

static
name

ProgramCache

memberof

PIXI.utils

Type declaration

Const TextureCache

TextureCache: {}
todo

Describe property usage

static
name

TextureCache

memberof

PIXI.utils

Type declaration

earcut

earcut: EarcutStatic

earcut

earcut: EarcutStatic

Const isMobile

isMobile: isMobileResult

Const premultiplyBlendMode

premultiplyBlendMode: number[][]

maps premultiply flag and blendMode to adjusted blendMode

memberof

PIXI.utils

const

premultiplyBlendMode

Const url

url: { format: FormatFunction; parse: ParseFunction; resolve: ResolveFunction }

Type declaration

  • format: FormatFunction
  • parse: ParseFunction
  • resolve: ResolveFunction

Functions

clearTextureCache

  • clearTextureCache(): void
  • Removes all textures from cache, but does not destroy them

    memberof

    PIXI.utils

    function

    clearTextureCache

    Returns void

correctBlendMode

  • correctBlendMode(blendMode: number, premultiplied: boolean): number
  • changes blendMode according to texture format

    memberof

    PIXI.utils

    function

    correctBlendMode

    Parameters

    • blendMode: number

      supposed blend mode

    • premultiplied: boolean

      whether source is premultiplied

    Returns number

    true blend mode for this texture

createIndicesForQuads

  • createIndicesForQuads(size: number, outBuffer?: Uint16Array | Uint32Array): Uint16Array | Uint32Array
  • Generic Mask Stack data structure

    memberof

    PIXI.utils

    function

    createIndicesForQuads

    Parameters

    • size: number

      Number of quads

    • Optional outBuffer: Uint16Array | Uint32Array

    Returns Uint16Array | Uint32Array

    • Resulting index buffer

decomposeDataUri

  • Split a data URI into components. Returns undefined if parameter dataUri is not a valid data URI.

    memberof

    PIXI.utils

    function

    decomposeDataUri

    Parameters

    • dataUri: string

      the data URI to check

    Returns DecomposedDataUri

    The decomposed data uri or undefined

deprecation

  • deprecation(version: string, message: string, ignoreDepth?: number): void
  • Helper for warning developers about deprecated features & settings. A stack track for warnings is given; useful for tracking-down where deprecated methods/properties/classes are being used within the code.

    memberof

    PIXI.utils

    function

    deprecation

    Parameters

    • version: string

      The version where the feature became deprecated

    • message: string

      Message should include what is deprecated, where, and the new solution

    • Optional ignoreDepth: number

    Returns void

destroyTextureCache

  • destroyTextureCache(): void
  • Destroys all texture in the cache

    memberof

    PIXI.utils

    function

    destroyTextureCache

    Returns void

getBufferType

  • getBufferType(array: ITypedArray): "Float32Array" | "Uint32Array" | "Int32Array" | "Uint16Array" | "Uint8Array" | null
  • Parameters

    Returns "Float32Array" | "Uint32Array" | "Int32Array" | "Uint16Array" | "Uint8Array" | null

getResolutionOfUrl

  • getResolutionOfUrl(url: string, defaultValue?: number): number
  • get the resolution / device pixel ratio of an asset by looking for the prefix used by spritesheets and image urls

    memberof

    PIXI.utils

    function

    getResolutionOfUrl

    Parameters

    • url: string

      the image path

    • Optional defaultValue: number

    Returns number

    resolution / device pixel ratio of an asset

hex2rgb

  • hex2rgb(hex: number, out?: number[] | Float32Array): number[] | Float32Array
  • Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).

    example

    PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1]

    memberof

    PIXI.utils

    function

    hex2rgb

    Parameters

    • hex: number

      The hexadecimal number to convert

    • Optional out: number[] | Float32Array

    Returns number[] | Float32Array

    An array representing the [R, G, B] of the color where all values are floats.

hex2string

  • hex2string(hex: number): string
  • Converts a hexadecimal color number to a string.

    example

    PIXI.utils.hex2string(0xffffff); // returns "#ffffff"

    memberof

    PIXI.utils

    function

    hex2string

    Parameters

    • hex: number

      Number in hex (e.g., 0xffffff)

    Returns string

    The string color (e.g., "#ffffff").

interleaveTypedArrays

  • interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array
  • Parameters

    • arrays: PackedArray[]
    • sizes: number[]

    Returns Float32Array

isPow2

  • isPow2(v: number): boolean
  • Checks if a number is a power of two.

    function

    isPow2

    memberof

    PIXI.utils

    Parameters

    • v: number

      input value

    Returns boolean

    true if value is power of two

isWebGLSupported

  • isWebGLSupported(): boolean
  • Helper for checking for WebGL support.

    memberof

    PIXI.utils

    function

    isWebGLSupported

    Returns boolean

    Is WebGL supported.

log2

  • log2(v: number): number
  • Computes ceil of log base 2

    function

    log2

    memberof

    PIXI.utils

    Parameters

    • v: number

      input value

    Returns number

    logarithm base 2

nextPow2

  • nextPow2(v: number): number
  • Rounds to next power of two.

    function

    nextPow2

    memberof

    PIXI.utils

    Parameters

    • v: number

      input value

    Returns number

premultiplyRgba

  • premultiplyRgba(rgb: Float32Array | number[], alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array
  • combines rgb and alpha to out array

    memberof

    PIXI.utils

    function

    premultiplyRgba

    Parameters

    • rgb: Float32Array | number[]

      input rgb

    • alpha: number

      alpha param

    • Optional out: Float32Array
    • Optional premultiply: boolean

    Returns Float32Array

    vec4 rgba

premultiplyTint

  • premultiplyTint(tint: number, alpha: number): number
  • premultiplies tint

    memberof

    PIXI.utils

    function

    premultiplyTint

    Parameters

    • tint: number

      integer RGB

    • alpha: number

      floating point alpha (0.0-1.0)

    Returns number

    tint multiplied by alpha

premultiplyTintToRgba

  • premultiplyTintToRgba(tint: number, alpha: number, out: Float32Array, premultiply?: boolean): Float32Array
  • converts integer tint and float alpha to vec4 form, premultiplies by default

    memberof

    PIXI.utils

    function

    premultiplyTintToRgba

    Parameters

    • tint: number

      input tint

    • alpha: number

      alpha param

    • out: Float32Array
    • Optional premultiply: boolean

    Returns Float32Array

    vec4 rgba

removeItems

  • removeItems(arr: any[], startIdx: number, removeCount: number): void
  • Remove items from a javascript array without generating garbage

    function

    removeItems

    memberof

    PIXI.utils

    Parameters

    • arr: any[]

      Array to remove elements from

    • startIdx: number

      starting index

    • removeCount: number

      how many to remove

    Returns void

rgb2hex

  • rgb2hex(rgb: number[] | Float32Array): number
  • Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.

    example

    PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff

    memberof

    PIXI.utils

    function

    rgb2hex

    Parameters

    • rgb: number[] | Float32Array

      Array of numbers where all values are normalized floats from 0.0 to 1.0.

    Returns number

    Number in hexadecimal.

sayHello

  • sayHello(type: string): void
  • Logs out the version and renderer information for this running instance of PIXI. If you don't want to see this message you can run PIXI.utils.skipHello() before creating your renderer. Keep in mind that doing that will forever make you a jerk face.

    static
    function

    sayHello

    memberof

    PIXI.utils

    Parameters

    • type: string

      The string renderer type to log.

    Returns void

sign

  • sign(n: number): -1 | 0 | 1
  • Returns sign of number

    memberof

    PIXI.utils

    function

    sign

    Parameters

    • n: number

      the number to check the sign of

    Returns -1 | 0 | 1

    0 if n is 0, -1 if n is negative, 1 if n is positive

skipHello

  • skipHello(): void
  • Skips the hello message of renderers that are created after this is run.

    function

    skipHello

    memberof

    PIXI.utils

    Returns void

string2hex

  • string2hex(string: string): number
  • Converts a string to a hexadecimal color number. It can handle: hex strings starting with #: "#ffffff" hex strings starting with 0x: "0xffffff" hex strings without prefix: "ffffff" css colors: "black"

    example

    PIXI.utils.string2hex("#ffffff"); // returns 0xffffff

    memberof

    PIXI.utils

    function

    string2hex

    Parameters

    • string: string

      The string color (e.g., "#ffffff")

    Returns number

    Number in hexadecimal.

trimCanvas

  • trimCanvas(canvas: HTMLCanvasElement): { data?: ImageData; height: number; width: number }
  • Trim transparent borders from a canvas

    memberof

    PIXI.utils

    function

    trimCanvas

    Parameters

    • canvas: HTMLCanvasElement

      the canvas to trim

    Returns { data?: ImageData; height: number; width: number }

    Trim data

    • Optional data?: ImageData
    • height: number
    • width: number

uid

  • uid(): number
  • Gets the next unique identifier

    memberof

    PIXI.utils

    function

    uid

    Returns number

    The next unique identifier to use.

Generated using TypeDoc