Appearance
hxg
Table of contents
Enumerations
Classes
- Animation
- Application
- Audio
- AudioLoader
- BaseTexture
- Button
- Component
- Container
- DisplayObjects
- EventSystem
- Graphics
- GroupLoader
- ImageLoader
- JsonLoader
- Layout
- Mask
- Matrix
- NinePanel
- Node
- Rect
- Renderer
- Resource
- Sprite
- SpriteSheet
- SpriteSheetAnimation
- Text
- Texture
- Thing
- Ticker
- Transform
- Vector2
Interfaces
Type Aliases
- AtlasFrame
- Constructor
- LoadOptions
- LoadResListConfig
- Options
- Props
- SheetFrames
- TextureResource
- TransformEvent
Variables
Functions
Type Aliases
AtlasFrame
Ƭ AtlasFrame: Object
Type declaration
Name | Type | Description |
---|---|---|
frame | { h : number ; w : number ; x : number ; y : number } | 原图裁剪参数 |
frame.h | number | - |
frame.w | number | - |
frame.x | number | - |
frame.y | number | - |
pivot | { x : number ; y : number } | - |
pivot.x | number | - |
pivot.y | number | - |
rotated | boolean | - |
sourceSize | { h : number ; w : number } | 即将渲染的画布尺寸(不确定) |
sourceSize.h | number | - |
sourceSize.w | number | - |
spriteSourceSize | { h : number ; w : number ; x : number ; y : number } | 裁剪后的修正尺寸(放到即将渲染的画布的实际位置和尺寸)(不确定) |
spriteSourceSize.h | number | - |
spriteSourceSize.w | number | - |
spriteSourceSize.x | number | - |
spriteSourceSize.y | number | - |
Defined in
src/core/component/SpriteSheet.ts:8
Constructor
Ƭ Constructor<T
>: (...args
: any
[]) => T
Type parameters
Name | Type |
---|---|
T | unknown |
Type declaration
• (...args
)
Parameters
Name | Type |
---|---|
...args | any [] |
Defined in
src/core/transform/Transform.ts:9
LoadOptions
Ƭ LoadOptions: Object
资源加载参数
Type declaration
Name | Type | Description |
---|---|---|
loader? | ILoader | 当前资源的独特加载器 |
type | string | 类型 |
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
Props
Ƭ Props<T
>: { [P in keyof T]?: Props<T[P]> }
Type parameters
Name |
---|
T |
Defined in
SheetFrames
Ƭ SheetFrames: Object
Type declaration
Name | Type |
---|---|
animations | { Attack : string [] } |
animations.Attack | string [] |
frames | Record <string , AtlasFrame > |
meta | { app : string ; format : string ; image : string ; scale : number ; size : { h : number ; w : number } ; version : string } |
meta.app | string |
meta.format | string |
meta.image | string |
meta.scale | number |
meta.size | { h : number ; w : number } |
meta.size.h | number |
meta.size.w | number |
meta.version | string |
Defined in
src/core/component/SpriteSheet.ts:43
TextureResource
Ƭ TextureResource: HTMLImageElement
| HTMLCanvasElement
| ImageBitmap
Defined in
TransformEvent
Ƭ TransformEvent: ValueOf
<typeof Event
> | `${TouchEvent}`
Defined in
src/core/transform/Transform.ts:10
Variables
ticker
• Const
ticker: Ticker
Defined in
Functions
canvas2d
▸ canvas2d(canvas
): (app
: Application
) => void
canvas2d相关工作
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
Returns
fn
▸ (app
): void
Parameters
Name | Type |
---|---|
app | Application |
Returns
void
Defined in
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
Name | Type | Description |
---|---|---|
point | Vector2 | 要判断的点 |
transform | Transform <Container > | 节点位置信息 |
Returns
boolean
Defined in
request
▸ request(url
): Promise
<XMLHttpRequest
>
Parameters
Name | Type |
---|---|
url | string |
Returns
Promise
<XMLHttpRequest
>
Defined in
setProps
▸ setProps<T
>(obj
, props
): void
快速设置
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
obj | T |
props | Props <T > |
Returns
void
Defined in
touchEventListener
▸ touchEventListener(canvas
): (app
: Application
) => void
Parameters
Name | Type |
---|---|
canvas | HTMLCanvasElement |
Returns
fn
▸ (app
): void
Parameters
Name | Type |
---|---|
app | Application |
Returns
void