Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextureBase

贴图资源基类。它定义了所有贴图共用的概念。

Hierarchy

Index

Constructors

constructor

Properties

__asyncLoadAssets__

__asyncLoadAssets__: boolean = false

__depends__

__depends__: any = null

__nativeDepend__

__nativeDepend__: any = null

__onLoadedInvoked__

__onLoadedInvoked__: boolean = false

Protected _anisotropy

_anisotropy: number = 8

Protected _format

_format: number = PixelFormat.RGBA8888

Private _gfxDevice

_gfxDevice: Device | null = null

Private _gfxSampler

_gfxSampler: Sampler | null = null

Protected _height

_height: number = 1

Private _id

_id: string

Protected _magFilter

_magFilter: number = Filter.LINEAR

Protected _minFilter

_minFilter: number = Filter.LINEAR

Protected _mipFilter

_mipFilter: number = Filter.NONE

_native

_native: string = ""

用于本机资产的可序列化URL。供内部使用。

default

""

_nativeUrl

_nativeUrl: string = ""

Private _samplerHash

_samplerHash: number = 0

Private _samplerInfo

_samplerInfo: (undefined | number)[] = []

Private _textureHash

_textureHash: number = 0

_uuid

_uuid: string

Protected _width

_width: number = 1

Protected _wrapR

_wrapR: number = WrapMode.REPEAT

Protected _wrapS

_wrapS: number = WrapMode.REPEAT

Protected _wrapT

_wrapT: number = WrapMode.REPEAT

loaded

loaded: boolean = true

该资源是否已经成功加载。

Static Filter

Filter: Filter = Filter

纹理过滤模式枚举类型

Static PixelFormat

PixelFormat: PixelFormat = PixelFormat

像素格式枚举类型

Static WrapMode

WrapMode: WrapMode = WrapMode

环绕模式枚举类型

Static preventDeferredLoadDependents

preventDeferredLoadDependents: boolean = false

当场景或 Prefab 被标记为 asyncLoadAssets,禁止延迟加载该资源所依赖的其它原始资源。

default

false

Static preventPreloadNativeObject

preventPreloadNativeObject: boolean = false

禁止预加载原生对象。

default

false

Accessors

Private nativeAsset

  • get nativeAsset(): any
  • set nativeAsset(obj: any): void
  • 此资源的基础资源(如果有)。 此属性可用于访问与资源相关的其他详细信息或功能。
    如果_native可用,则此属性将由加载器初始化。

    default

    null

    Returns any

  • 此资源的基础资源(如果有)。 此属性可用于访问与资源相关的其他详细信息或功能。
    如果_native可用,则此属性将由加载器初始化。

    default

    null

    Parameters

    • obj: any

    Returns void

nativeDep

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

height

  • get height(): number

isCompressed

  • get isCompressed(): boolean

nativeUrl

  • get nativeUrl(): string

refCount

  • get refCount(): number

width

  • get width(): number

Methods

deserialize

  • deserialize(serializedData: any, handle: any): void

Protected getGFXDevice

  • _getGFXDevice(): Device | null

Protected getGFXFormat

Protected getGFXPixelFormat

  • getGFXPixelFormat(format: any): Format

serialize

  • serialize(ctxForExporting: any): any

Protected setGFXFormat

Private setRawAsset

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

addRef

Optional createNode

decRef

  • decRef(autoRelease?: boolean): Asset

destroy

  • destroy(): any

getAnisotropy

  • getAnisotropy(): number

getGFXSampler

getGFXTexture

getHash

  • getHash(): number

getId

  • getId(): string

getPixelFormat

  • getPixelFormat(): number

Private getSamplerHash

  • getSamplerHash(): number

onLoaded

  • onLoaded(): void

Private serialize

  • serialize(): void

setAnisotropy

  • setAnisotropy(anisotropy: number): void

setFilters

setMipFilter

  • setMipFilter(mipFilter: Filter): void

setWrapMode

toString

  • toString(): string
  • 返回对象的字符串表示形式。
    Asset 对象将会重写 Object 对象的 toString() 方法。
    当资源要表示为文本值时或在字符串连接时引用时,
    JavaScript 会自动调用 toString() 方法。

    对于原始类型的资源,它将返回this.nativeUrl
    否则,返回空字符串。
    子类可能会覆盖此方法。

    method

    toString

    Returns string

Static deserialize

  • deserialize(data: any): any

Generated using TypeDoc