mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
added TypeScript definitions for Key and CursorKeys object
This commit is contained in:
parent
5cf7ed4fdb
commit
6be31e0f69
1 changed files with 28 additions and 1 deletions
29
build/phaser.d.ts
vendored
29
build/phaser.d.ts
vendored
|
@ -255,7 +255,7 @@ declare module Phaser {
|
||||||
randomY: number;
|
randomY: number;
|
||||||
boot(): void;
|
boot(): void;
|
||||||
update(): void;
|
update(): void;
|
||||||
setSize(width: number, height: number): void;
|
setBounds( x:number, y:number, width: number, height: number): void;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,6 +366,32 @@ declare module Phaser {
|
||||||
addPointer(): Phaser.Pointer;
|
addPointer(): Phaser.Pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Key {
|
||||||
|
constructor( game:Phaser.Game, keycode:number )
|
||||||
|
isDown:boolean;
|
||||||
|
isUp:boolean;
|
||||||
|
altKey:boolean;
|
||||||
|
ctrlKey:boolean;
|
||||||
|
shiftKey:boolean;
|
||||||
|
timeDown:number;
|
||||||
|
duration:number;
|
||||||
|
timeUp:number;
|
||||||
|
repeats:number;
|
||||||
|
keycode:number;
|
||||||
|
onDown:Phaser.Signal;
|
||||||
|
onUp:Phaser.Signal;
|
||||||
|
justPressed( duration:number ):boolean;
|
||||||
|
justReleased( duration:number ):boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CursorKeys
|
||||||
|
{
|
||||||
|
up:Phaser.Key;
|
||||||
|
down:Phaser.Key;
|
||||||
|
left:Phaser.Key;
|
||||||
|
right:Phaser.Key;
|
||||||
|
}
|
||||||
|
|
||||||
class Keyboard {
|
class Keyboard {
|
||||||
constructor(game: Phaser.Game);
|
constructor(game: Phaser.Game);
|
||||||
game: Phaser.Game;
|
game: Phaser.Game;
|
||||||
|
@ -479,6 +505,7 @@ declare module Phaser {
|
||||||
justPressed(keycode: number, duration?: number): boolean;
|
justPressed(keycode: number, duration?: number): boolean;
|
||||||
justReleased(keycode: number, duration?: number): boolean;
|
justReleased(keycode: number, duration?: number): boolean;
|
||||||
isDown(keycode: number): boolean;
|
isDown(keycode: number): boolean;
|
||||||
|
createCursorKeys():CursorKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Mouse {
|
class Mouse {
|
||||||
|
|
Loading…
Reference in a new issue