Skip to content
On this page

hxg

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AtlasFrame

Ƭ AtlasFrame: Object

Type declaration

NameTypeDescription
frame{ h: number ; w: number ; x: number ; y: number }原图裁剪参数
frame.hnumber-
frame.wnumber-
frame.xnumber-
frame.ynumber-
pivot{ x: number ; y: number }-
pivot.xnumber-
pivot.ynumber-
rotatedboolean-
sourceSize{ h: number ; w: number }即将渲染的画布尺寸(不确定)
sourceSize.hnumber-
sourceSize.wnumber-
spriteSourceSize{ h: number ; w: number ; x: number ; y: number }裁剪后的修正尺寸(放到即将渲染的画布的实际位置和尺寸)(不确定)
spriteSourceSize.hnumber-
spriteSourceSize.wnumber-
spriteSourceSize.xnumber-
spriteSourceSize.ynumber-

Defined in

src/core/component/SpriteSheet.ts:8


Constructor

Ƭ Constructor<T>: (...args: any[]) => T

Type parameters

NameType
Tunknown

Type declaration

• (...args)

Parameters
NameType
...argsany[]

Defined in

src/core/transform/Transform.ts:9


LoadOptions

Ƭ LoadOptions: Object

资源加载参数

Type declaration

NameTypeDescription
loader?ILoader当前资源的独特加载器
typestring类型

Defined in

src/core/resource/Resource.ts:19


LoadResListConfig

Ƭ LoadResListConfig: (string | [string, string])[]

资源列表

Defined in

src/core/resource/GroupLoader.ts:7


Options

Ƭ Options: Partial<{ height: number ; width: number }>

Defined in

src/core/Application.ts:5


Props

Ƭ Props<T>: { [P in keyof T]?: Props<T[P]> }

Type parameters

Name
T

Defined in

src/core/utils/setProps.ts:1


SheetFrames

Ƭ SheetFrames: Object

Type declaration

NameType
animations{ Attack: string[] }
animations.Attackstring[]
framesRecord<string, AtlasFrame>
meta{ app: string ; format: string ; image: string ; scale: number ; size: { h: number ; w: number } ; version: string }
meta.appstring
meta.formatstring
meta.imagestring
meta.scalenumber
meta.size{ h: number ; w: number }
meta.size.hnumber
meta.size.wnumber
meta.versionstring

Defined in

src/core/component/SpriteSheet.ts:43


TextureResource

Ƭ TextureResource: HTMLImageElement | HTMLCanvasElement | ImageBitmap

Defined in

src/core/texture/Texture.ts:4


TransformEvent

Ƭ TransformEvent: ValueOf<typeof Event> | `${TouchEvent}`

Defined in

src/core/transform/Transform.ts:10

Variables

ticker

Const ticker: Ticker

Defined in

src/core/ticker/Ticker.ts:110

Functions

canvas2d

canvas2d(canvas): (app: Application) => void

canvas2d相关工作

Parameters

NameType
canvasHTMLCanvasElement

Returns

fn

▸ (app): void

Parameters
NameType
appApplication
Returns

void

Defined in

src/core/canvas2d/index.ts:23


isHitPoint

isHitPoint(point, transform): boolean

判断点是否落在某个tansform区域

ts
// 创建节点
const node = new Transform();
// 设置位置
node.position.set(100, 100);
// 设置大小
node.size.set(100, 100);
// 插入到舞台
app.stage.addChild(node);
// 落点判定
const isHit = isHitPoint(node, { x: 150, y: 150 });
console.log('isHit', isHit);

Parameters

NameTypeDescription
pointVector2要判断的点
transformTransform<Container>节点位置信息

Returns

boolean

Defined in

src/core/utils/hitTest.ts:23


request

request(url): Promise<XMLHttpRequest>

Parameters

NameType
urlstring

Returns

Promise<XMLHttpRequest>

Defined in

src/core/utils/request.ts:1


setProps

setProps<T>(obj, props): void

快速设置

Type parameters

Name
T

Parameters

NameType
objT
propsProps<T>

Returns

void

Defined in

src/core/utils/setProps.ts:9


touchEventListener

touchEventListener(canvas): (app: Application) => void

Parameters

NameType
canvasHTMLCanvasElement

Returns

fn

▸ (app): void

Parameters
NameType
appApplication
Returns

void

Defined in

src/core/event/touchEventListener.ts:39