Skip to content

Commit 4b4ba34

Browse files
committed
Merge pull request phaserjs#1999 from qdrj/dev
Fix JS doc and typescript definitions for cache.getRenderTexture
2 parents ac77bb8 + c418ccb commit 4b4ba34

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/loader/Cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ Phaser.Cache.prototype = {
13711371
*
13721372
* @method Phaser.Cache#getRenderTexture
13731373
* @param {string} key - The key of the asset to retrieve from the cache.
1374-
* @return {Phaser.RenderTexture} The RenderTexture object.
1374+
* @return {Object} The object with Phaser.RenderTexture and Phaser.Frame.
13751375
*/
13761376
getRenderTexture: function (key) {
13771377

tasks/options/buildtsdoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ module.exports = {
99
tsDefFileName: 'typescript/phaser.d.ts',
1010
jsdocJsonFileName: 'out/docs.json',
1111
dest: 'typescript/phaser.comments.d.ts'
12-
},
12+
}
1313
};

tasks/options/jsdoc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
}
1010
},
1111
json: {
12+
jsdoc: './node_modules/.bin/jsdoc',
1213
src: [],
1314
options: {
1415
configure: 'tasks/jsdocexportjson-conf.json',

typescript/phaser.d.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ declare module Phaser {
475475
getPixiTexture(key: string): PIXI.Texture;
476476
getPixiBaseTexture(key: string): PIXI.BaseTexture;
477477
getPhysicsData(key: string, object?: string, fixtureKey?: string): any[];
478-
getRenderTexture(key: string): Phaser.RenderTexture;
478+
getRenderTexture(key: string): Phaser.CachedRenderTexture;
479479
getShader(key: string): string;
480480
getSound(key: string): Phaser.Sound;
481481
getSoundData(key: string): any;
@@ -516,15 +516,22 @@ declare module Phaser {
516516
updateSound(key: string, property: string, value: Phaser.Sound): void;
517517

518518
}
519-
519+
520520
interface CachedImage {
521521

522-
key: string,
523-
url: string,
524-
data: HTMLImageElement,
525-
base: PIXI.BaseTexture,
526-
frame: Phaser.Frame,
527-
frameData: Phaser.FrameData
522+
key: string,
523+
url: string,
524+
data: HTMLImageElement,
525+
base: PIXI.BaseTexture,
526+
frame: Phaser.Frame,
527+
frameData: Phaser.FrameData
528+
529+
}
530+
531+
interface CachedRenderTexture {
532+
533+
frame: Phaser.Frame;
534+
texture: Phaser.RenderTexture;
528535

529536
}
530537

0 commit comments

Comments
 (0)