kagurajs - v0.2.7 / Exports / Kagura
Class: Kagura
create kagura instance
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Kagura(options?
)
Parameters
Name | Type |
---|---|
options? | KaguraInitOptions |
Defined in
Properties
#fpsData
• Private
#fpsData: Fpsdata
Defined in
#scene
• Private
Optional
#scene: Scene
Defined in
#sceneData
• Private
#sceneData: SceneData
Defined in
#size
• Private
#size: Object
Type declaration
Name | Type |
---|---|
height | number |
width | number |
Defined in
#startDatas
• Private
#startDatas: StartDatas
Defined in
#startReturn
• Private
#startReturn: StartReturn
Defined in
#startWaitPromises
• Private
#startWaitPromises: Promise
<any
>[]
Defined in
element
• element: HTMLCanvasElement
Defined in
pixiApp
• pixiApp: Application
<ICanvas
>
Defined in
Accessors
fps
• get
fps(): number
Returns
number
Defined in
• set
fps(fps
): void
Parameters
Name | Type |
---|---|
fps | number |
Returns
void
Defined in
height
• get
height(): number
Return canvas height
Returns
number
Defined in
• set
height(height
): void
Parameters
Name | Type |
---|---|
height | number |
Returns
void
Defined in
width
• get
width(): number
Return canvas width
Returns
number
Defined in
• set
width(width
): void
Parameters
Name | Type |
---|---|
width | number |
Returns
void
Defined in
Methods
resetStartDatas
▸ resetStartDatas(): void
Returns
void
Defined in
restart
▸ restart(): Promise
<StartReturn
>
Restart KaguraJS instance.
Returns
Promise
<StartReturn
>
Remarks
It is equivalent to this code👇
await kagura.stop()
await kaguta.start()
Defined in
setCanvasSize
▸ setCanvasSize(width
, height
): void
Set canvas size
Parameters
Name | Type | Description |
---|---|---|
width | number | New canvas width |
height | number | New canvas height |
Returns
void
Defined in
setScene
▸ setScene(NewScene
): Promise
<void
>
Parameters
Name | Type |
---|---|
NewScene | typeof Scene |
Returns
Promise
<void
>
Defined in
start
▸ start(): Promise
<StartReturn
>
Start KaguraJS game.
Returns
Promise
<StartReturn
>
Example
const kagura: Kagura = new Kagura()
// Start kagura
kagura.start()
Defined in
stop
▸ stop(): Promise
<void
>
Stop KaguraJS instance.
Returns
Promise
<void
>