Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ImageAsset

Image Asset.

Hierarchy

Index

Constructors

constructor

Properties

__asyncLoadAssets__

__asyncLoadAssets__: boolean = false

__depends__

__depends__: any = null

__nativeDepend__

__nativeDepend__: any = null

__onLoadedInvoked__

__onLoadedInvoked__: boolean = false

Private _exportedExts

_exportedExts: string[] | null | undefined = undefined

Private _format

_format: PixelFormat = PixelFormat.RGBA8888

Private _height

_height: number = 0

_native

_native: string = ""

Serializable url for native asset. For internal usage.

default

""

Private _nativeData

_nativeData: ImageSource

_nativeUrl

_nativeUrl: string = ""

Private _tex

_tex: any

_uuid

_uuid: string

Private _width

_width: number = 0

loaded

loaded: boolean = true

Whether the asset is loaded or not

Static Private extnames

extnames: string[] = ['.png', '.jpg', '.jpeg', '.bmp', '.webp', '.pvr', '.pkm', '.astc']

Static preventDeferredLoadDependents

preventDeferredLoadDependents: boolean = false

Indicates whether its dependent native assets can support deferred load if the owner scene (or prefab) is marked as asyncLoadAssets.

default

false

Static preventPreloadNativeObject

preventPreloadNativeObject: boolean = false

Indicates whether its native object should be preloaded from native url.

default

false

Accessors

nativeAsset

nativeDep

  • get nativeDep(): undefined | { __isNative__: boolean; ext: string; uuid: string }

Private texture

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

data

  • get data(): null | ArrayBufferView | HTMLCanvasElement | HTMLImageElement | ImageBitmap

format

height

  • get height(): number

isCompressed

  • get isCompressed(): boolean

nativeUrl

  • get nativeUrl(): string

refCount

  • get refCount(): number

url

  • get url(): string

width

  • get width(): number

Methods

deserialize

  • deserialize(data: any): void

onDataComplete

  • _onDataComplete(): void

serialize

  • serialize(): undefined | "" | { fmt: string; h: number; w: number }

Private setRawAsset

  • setRawAsset(filename: string, inLibrary?: boolean): void

addRef

Optional createNode

decRef

  • decRef(autoRelease?: boolean): Asset

destroy

  • destroy(): any

onLoaded

  • onLoaded(): void

reset

Private serialize

  • serialize(): void

toString

  • toString(): string
  • Returns the string representation of the object.
    The Asset object overrides the toString() method of the Object object.
    JavaScript calls the toString() method automatically
    when an asset is to be represented as a text value or when a texture is referred to in a string concatenation.

    For assets of the native type, it will return this.nativeUrl.
    Otherwise, an empty string is returned.
    This method may be overwritten by subclasses.

    method

    toString

    Returns string

Static deserialize

  • deserialize(data: any): any

Generated using TypeDoc