Skip to content

Commit aaeb45e

Browse files
committed
- Update Phaser.Cache.addImage() signature
- Update Phaser.Cache.getImage() signature - Add Phaser.CachedImage interface
1 parent 3fd35d0 commit aaeb45e

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

typescript/phaser.d.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ declare module Phaser {
421421
addBitmapFont(key: string, url: string, data: any, atlasData: any, atlasType: string, xSpacing?: number, ySpacing?: number): void;
422422
addCanvas(key: string, canvas: HTMLCanvasElement, context?: CanvasRenderingContext2D): void;
423423
addDefaultImage(): void;
424-
addImage(key: string, url: string, data: any): void;
424+
addImage(key: string, url: string, data: any): Phaser.CachedImage;
425425
addJSON(key: string, urL: string, data: any): void;
426426
addMissingImage(): void;
427427
addPhysicsData(key: string, url: string, JSONData: any, format: number): void;
@@ -465,7 +465,7 @@ declare module Phaser {
465465
getFrameByName(key: string, name: string, cache?: number): Phaser.Frame;
466466
getFrameCount(key: string, cache?: number): number;
467467
getFrameData(key: string, cache?: number): Phaser.FrameData;
468-
getImage(key: string, full?: boolean): Phaser.Image;
468+
getImage(key: string, full?: boolean): Phaser.CachedImage;
469469
getItem(key: string, cache: number, method?: string, property?: string): any;
470470
getJSON(key: string, clone?: boolean): any;
471471
getKeys(cache: number): string[];
@@ -513,6 +513,17 @@ declare module Phaser {
513513
updateSound(key: string, property: string, value: Phaser.Sound): void;
514514

515515
}
516+
517+
interface CachedImage {
518+
519+
key: string,
520+
url: string,
521+
data: HTMLImageElement,
522+
base: PIXI.BaseTexture,
523+
frame: Phaser.Frame,
524+
frameData: Phaser.FrameData
525+
526+
}
516527

517528
class Camera {
518529

0 commit comments

Comments
 (0)