Skip to content
On this page

kagurajs - v0.2.7 / Exports / Kagura

Class: Kagura

create kagura instance

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Kagura(options?)

Parameters

NameType
options?KaguraInitOptions

Defined in

src/core/index.ts:35

Properties

#fpsData

Private #fpsData: Fpsdata

Defined in

src/core/index.ts:28


#scene

Private Optional #scene: Scene

Defined in

src/core/index.ts:29


#sceneData

Private #sceneData: SceneData

Defined in

src/core/index.ts:30


#size

Private #size: Object

Type declaration

NameType
heightnumber
widthnumber

Defined in

src/core/index.ts:23


#startDatas

Private #startDatas: StartDatas

Defined in

src/core/index.ts:34


#startReturn

Private #startReturn: StartReturn

Defined in

src/core/index.ts:33


#startWaitPromises

Private #startWaitPromises: Promise<any>[]

Defined in

src/core/index.ts:32


element

element: HTMLCanvasElement

Defined in

src/core/index.ts:22


pixiApp

pixiApp: Application<ICanvas>

Defined in

src/core/index.ts:31

Accessors

fps

get fps(): number

Returns

number

Defined in

src/core/index.ts:119

set fps(fps): void

Parameters

NameType
fpsnumber

Returns

void

Defined in

src/core/index.ts:115


height

get height(): number

Return canvas height

Returns

number

Defined in

src/core/index.ts:101

set height(height): void

Parameters

NameType
heightnumber

Returns

void

Defined in

src/core/index.ts:86


width

get width(): number

Return canvas width

Returns

number

Defined in

src/core/index.ts:94

set width(width): void

Parameters

NameType
widthnumber

Returns

void

Defined in

src/core/index.ts:81

Methods

resetStartDatas

resetStartDatas(): void

Returns

void

Defined in

src/core/index.ts:188


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

src/core/index.ts:183


setCanvasSize

setCanvasSize(width, height): void

Set canvas size

Parameters

NameTypeDescription
widthnumberNew canvas width
heightnumberNew canvas height

Returns

void

Defined in

src/core/index.ts:110


setScene

setScene(NewScene): Promise<void>

Parameters

NameType
NewScenetypeof Scene

Returns

Promise<void>

Defined in

src/core/index.ts:142


start

start(): Promise<StartReturn>

Start KaguraJS game.

Returns

Promise<StartReturn>

Example

ts
const kagura: Kagura = new Kagura()
// Start kagura
kagura.start()

Defined in

src/core/index.ts:132


stop

stop(): Promise<void>

Stop KaguraJS instance.

Returns

Promise<void>

Defined in

src/core/index.ts:162