gameforge - v0.1.12
    Preparing search index...

    Class BaseTexture<R, RO>

    A Texture stores the information that represents an image. All textures have a base texture, which contains information about the source. Therefore you can have many textures all using a single BaseTexture

    PIXI

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _batchEnabled: number

    Number of the texture batch, used by multi-texture renderers

    _batchLocation: number

    Location inside texture batch, used by multi-texture renderers

    alphaMode: ALPHA_MODES

    How to treat premultiplied alpha, see PIXI.ALPHA_MODES.

    PIXI.ALPHA_MODES.UNPACK
    
    anisotropicLevel: number

    Anisotropic filtering level of texture

    0
    
    cacheId: string

    Currently default cache ID.

    destroyed: boolean

    Flag if BaseTexture has been destroyed.

    dirtyId: number

    Used by TextureSystem to only update texture to the GPU when needed. Please call update() to increment it.

    dirtyStyleId: number

    Used by TextureSystem to only update texture style when needed.

    format: FORMATS

    The pixel format of the texture

    PIXI.FORMATS.RGBA
    
    height: number

    The height of the base texture set when the image has loaded

    isPowerOfTwo: boolean

    Whether or not the texture is a power of two, try to use power of two textures as much as you can

    false
    
    ktxKeyValueData: Map<string, DataView<ArrayBufferLike>>
    parentTextureArray: BaseTexture

    Whether its a part of another texture, handled by ArrayResource or CubeResource

    resolution: number

    The resolution / device pixel ratio of the texture

    PIXI.settings.RESOLUTION
    
    resource: R

    The resource used by this BaseTexture, there can only be one resource per BaseTexture, but textures can share resources.

    target: TARGETS

    The target type

    PIXI.TARGETS.TEXTURE_2D
    
    textureCacheIds: string[]

    The collection of alternative cache ids, since some BaseTextures can have more than one ID, short name and longer full URL

    touched: number

    Used by automatic texture Garbage Collection, stores last GC tick when it was bound

    type: TYPES

    The type of resource data

    PIXI.TYPES.UNSIGNED_BYTE
    
    uid: number

    Global unique identifier for this BaseTexture

    valid: boolean

    Generally speaking means when resource is loaded.

    width: number

    The width of the base texture set when the image has loaded

    _globalBatch: number

    Global number of the texture batch, used by multi-texture renderers.

    defaultOptions: IBaseTextureOptions

    Default options used when creating BaseTexture objects.

    PIXI.BaseTexture

    prefixed: string | boolean

    Accessors

    • get mipmap(): MIPMAP_MODES

      Mipmap mode of the texture, affects downscaled images

      Returns MIPMAP_MODES

      PIXI.MIPMAP_MODES.POW2
      
    • set mipmap(value: MIPMAP_MODES): void

      Parameters

      Returns void

    • get realHeight(): number

      Pixel height of the source of this texture

      Returns number

    • get realWidth(): number

      Pixel width of the source of this texture

      Returns number

    • get scaleMode(): SCALE_MODES

      The scale mode to apply when scaling this texture

      Returns SCALE_MODES

      PIXI.SCALE_MODES.LINEAR
      
    • set scaleMode(value: SCALE_MODES): void

      Parameters

      Returns void

    • get wrapMode(): WRAP_MODES

      How the texture wraps

      Returns WRAP_MODES

      PIXI.WRAP_MODES.CLAMP
      
    • set wrapMode(value: WRAP_MODES): void

      Parameters

      Returns void

    Methods

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Utility function for BaseTexture|Texture cast.

      Returns BaseTexture

    • Destroys this base texture. The method stops if resource doesn't want this texture to be destroyed. Removes texture from all caches.

      Returns void

      PIXI.BaseTexture#destroyed

    • Frees the texture from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again.

      Returns void

      PIXI.BaseTexture#dispose

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

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • ...args: any[]

      Returns boolean

    • 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

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T

      Returns ((...args: any[]) => void)[]

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

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

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

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

      Parameters

      • Optionalevent: string | symbol

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Sets real size of baseTexture, preserves current resolution.

      Parameters

      • realWidth: number

        Full rendered width

      • realHeight: number

        Full rendered height

      • Optionalresolution: number

        Optionally set resolution

      Returns this

      • this
    • Changes resolution

      Parameters

      • resolution: number

        res

      Returns this

      • this
    • Sets the resource if it wasn't set. Throws error if resource already present

      Parameters

      • resource: R

        that is managing this BaseTexture

      Returns this

      • this
    • Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.

      Parameters

      • desiredWidth: number

        Desired visual width

      • desiredHeight: number

        Desired visual height

      • Optionalresolution: number

        Optionally set resolution

      Returns this

      • this
    • Changes style options of BaseTexture

      Parameters

      Returns this

      • this
    • Invalidates the object. Texture becomes valid if width and height are greater than zero.

      Returns void

    • Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.

      Parameters

      • baseTexture: BaseTexture

        The BaseTexture to add to the cache.

      • id: string

        The id that the BaseTexture will be stored against.

      Returns void

    • Helper function that creates a base texture based on the source you provide. The source can be - image url, image element, canvas element. If the source is an image url or an image element and not in the base texture cache, it will be created and loaded.

      Type Parameters

      Parameters

      • source: string | ImageSource | string[]

        The source to create base texture from.

      • Optionaloptions: IBaseTextureOptions<RO>

        See PIXI.BaseTexture's constructor for options.

      • Optionalstrict: boolean

        Enforce strict-mode, see PIXI.settings.STRICT_TEXTURE_CACHE.

      Returns BaseTexture<R>

      The new base texture.