Skip to content
On this page

Class: Texture<T>

纹理
能力,能够完整的描述一张素材
统一传入处理
canvas 异步转 ImageBitmap

Type parameters

NameType
Textends TextureResource = TextureResource

Hierarchy

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new Texture<T>(source?)

Type parameters

NameType
Textends TextureResource = TextureResource

Parameters

NameType
source?T

Overrides

BaseTexture.constructor

Defined in

src/core/texture/Texture.ts:40

Properties

_source

Optional _source: T

Defined in

src/core/texture/Texture.ts:28


anchor

anchor: Vector2

Defined in

src/core/texture/Texture.ts:19


height

height: number = 0

截取高度

Inherited from

BaseTexture.height

Defined in

src/core/texture/BaseTexture.ts:20


init

init: boolean = false

是否进行了初始化/是否需要初始化

Defined in

src/core/texture/Texture.ts:26


left

left: number = 0

Defined in

src/core/texture/Texture.ts:17


rotation

rotation: number = 0

旋转

Defined in

src/core/texture/Texture.ts:16


sourceSize

Optional sourceSize: Vector2

Defined in

src/core/texture/Texture.ts:21


top

top: number = 0

Defined in

src/core/texture/Texture.ts:18


width

width: number = 0

截取宽度

Inherited from

BaseTexture.width

Defined in

src/core/texture/BaseTexture.ts:16


x

x: number = 0

记录x偏移

Inherited from

BaseTexture.x

Defined in

src/core/texture/BaseTexture.ts:8


y

y: number = 0

记录y偏移

Inherited from

BaseTexture.y

Defined in

src/core/texture/BaseTexture.ts:12

Accessors

source

get source(): T

Returns

T

Defined in

src/core/texture/Texture.ts:29

set source(val): void

Parameters

NameType
valT

Returns

void

Defined in

src/core/texture/Texture.ts:33