Options
All
  • Public
  • Public/Protected
  • All
Menu

Module asset

Index

References

BitmapFont

Re-exports BitmapFont

Font

Re-exports Font

IUV

Re-exports IUV

LabelAtlas

Re-exports LabelAtlas

SpriteAtlas

Re-exports SpriteAtlas

SpriteFrame

Re-exports SpriteFrame

TTFFont

Re-exports TTFFont

Type aliases

CreateNodeCallback

CreateNodeCallback: (error: Error | null, node: Node) => void
param

null or the error info

param

the created node or null

Type declaration

    • (error: Error | null, node: Node): void
    • Parameters

      • error: Error | null
      • node: Node

      Returns void

IBArray

IBArray: Uint8Array | Uint16Array | Uint32Array
en

Array views for index buffer

zh

允许存储索引的数组视图。

ITextureCubeCreateInfo

ITextureCubeCreateInfo: ITexture2DCreateInfo

ImageSource

ImageSource: HTMLCanvasElement | HTMLImageElement | IMemoryImageSource | ImageBitmap
en

The image source, can be HTML canvas, image type or image in memory data

zh

图像资源的原始图像源。可以来源于 HTML 元素也可以来源于内存。

PresumedGFXTextureInfo

PresumedGFXTextureInfo: Pick<TextureInfo, "usage" | "flags" | "format" | "levelCount">

Variables

Let CUSTOM_PIXEL_FORMAT

CUSTOM_PIXEL_FORMAT: number = 1024

Const INSET_BOTTOM

INSET_BOTTOM: 3 = 3

Const INSET_LEFT

INSET_LEFT: 0 = 0

Const INSET_RIGHT

INSET_RIGHT: 2 = 2

Const INSET_TOP

INSET_TOP: 1 = 1

Const OptimizationPolicy

OptimizationPolicy: { AUTO: number; MULTI_INSTANCE: number; SINGLE_INSTANCE: number } = Enum({/*** @en The optimization policy is automatically chosen based on the number of instantiations.* When you first create an instance, the behavior is the same as SINGLE_INSTANCE.* MULTI_INSTANCE will be automatically used after multiple creation.* @zh 根据创建次数自动调整优化策略。初次创建实例时,行为等同 SINGLE_INSTANCE,多次创建后将自动采用 MULTI_INSTANCE。*/AUTO: 0,/*** @en Optimize for single instance creation.<br>* This option skips code generation for this prefab.* When this prefab will usually create only one instances, please select this option.* @zh 优化单次创建性能。<br>* 该选项会跳过针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般只会创建一个实例时,请选择此项。*/SINGLE_INSTANCE: 1,/*** @en Optimize for creating instances multiple times.<br>* This option enables code generation for this prefab.* When this prefab will usually create multiple instances, please select this option.* It is also recommended to select this option if the prefab instance in the scene has Auto Sync enabled and there are multiple instances in the scene.* @zh 优化多次创建性能。<br>* 该选项会启用针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般会创建多个实例时,请选择此项。如果该 prefab 在场景中的节点启用了自动关联,并且在场景中有多份实例,也建议选择此项。*/MULTI_INSTANCE: 2,})
en

An enumeration used with the Prefab.optimizationPolicy to specify how to optimize the instantiate operation.

zh

Prefab 创建实例所用的优化策略,配合 Prefab.optimizationPolicy 使用。

Type declaration

  • AUTO: number
    en

    The optimization policy is automatically chosen based on the number of instantiations. When you first create an instance, the behavior is the same as SINGLE_INSTANCE. MULTI_INSTANCE will be automatically used after multiple creation.

    zh

    根据创建次数自动调整优化策略。初次创建实例时,行为等同 SINGLE_INSTANCE,多次创建后将自动采用 MULTI_INSTANCE。

  • MULTI_INSTANCE: number
    en

    Optimize for creating instances multiple times.
    This option enables code generation for this prefab. When this prefab will usually create multiple instances, please select this option. It is also recommended to select this option if the prefab instance in the scene has Auto Sync enabled and there are multiple instances in the scene.

    zh

    优化多次创建性能。
    该选项会启用针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般会创建多个实例时,请选择此项。如果该 prefab 在场景中的节点启用了自动关联,并且在场景中有多份实例,也建议选择此项。

  • SINGLE_INSTANCE: number
    en

    Optimize for single instance creation.
    This option skips code generation for this prefab. When this prefab will usually create only one instances, please select this option.

    zh

    优化单次创建性能。
    该选项会跳过针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般只会创建一个实例时,请选择此项。

Const _colorAttachment

_colorAttachment: ColorAttachment = new ColorAttachment()

Const _depthStencilAttachment

_depthStencilAttachment: DepthStencilAttachment = new DepthStencilAttachment()

Const _regions

_regions: BufferTextureCopy[] = [new BufferTextureCopy()]

Const globalEmptyMeshBuffer

globalEmptyMeshBuffer: Uint8Array = new Uint8Array()

Const idGenerator

idGenerator: IDGenerator = new IDGenerator('RenderTex')

Const idGenerator

idGenerator: IDGenerator = new IDGenerator('Tex')

isLittleEndian

isLittleEndian: any

Const passInfo

passInfo: RenderPassInfo = new RenderPassInfo([_colorAttachment], _depthStencilAttachment)

Const temp_uvs

temp_uvs: IUV[] = [{ u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0, v: 0 }]

Const v3_1

v3_1: Vec3 = new Vec3()

Const v3_2

v3_2: Vec3 = new Vec3()

Functions

forEachFace

getGlobalDevice

  • _getGlobalDevice(): Device | null

canGenerateMipmap

  • canGenerateMipmap(device: Device, w: number, h: number): false | true | 0

fetchImageSource

  • fetchImageSource(imageSource: ImageSource): null | ArrayBufferView | HTMLCanvasElement | HTMLImageElement | ImageBitmap

getComponentByteLength

  • getComponentByteLength(format: Format): number

getIndexStrideCtor

  • getIndexStrideCtor(stride: number): Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor
  • Parameters

    • stride: number

    Returns Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor

getMipLevel

  • getMipLevel(width: number, height: number): number

getOffset

  • getOffset(attributes: Attribute[], attributeIndex: number): number

getReader

  • getReader(dataView: DataView, format: Format): null | (Anonymous function)

getWriter

  • getWriter(dataView: DataView, format: Format): null | (Anonymous function)

isImageBitmap

  • isImageBitmap(imageSource: any): imageSource is ImageBitmap

isNativeImage

  • isNativeImage(imageSource: ImageSource): imageSource is HTMLCanvasElement | HTMLImageElement | ImageBitmap

isPOT

  • isPOT(n: number): false | true | 0

Object literals

Const windowInfo

windowInfo: object

height

height: number = 1

renderPassInfo

renderPassInfo: RenderPassInfo = passInfo

width

width: number = 1

Generated using TypeDoc