Skip to content

Commit 90a7a3e

Browse files
committed
Create video + added Video to config.
1 parent 8a9e0c2 commit 90a7a3e

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

build/config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'ninja' => false,
2323
'box2d' => false,
2424
'creature' => false,
25+
'video' => true,
2526
);
2627
}
2728

@@ -240,6 +241,15 @@
240241
<script src="$path/src/gameobjects/RetroFont.js"></script>
241242
242243
244+
EOL;
245+
}
246+
247+
if ($modules['video'])
248+
{
249+
echo <<<EOL
250+
<script src="$path/src/gameobjects/Video.js"></script>
251+
252+
243253
EOL;
244254
}
245255

src/gameobjects/GameObjectFactory.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,23 @@ Phaser.GameObjectFactory.prototype = {
415415

416416
},
417417

418+
/**
419+
* Create a Video object.
420+
*
421+
* The video file must have already been loaded into the Phaser.Cache.
422+
* The key given is the key you used when the video was preloaded.
423+
* This will return a Phaser.Video object which you can pass to a Sprite to be used as a texture.
424+
*
425+
* @method Phaser.GameObjectFactory#video
426+
* @param {string} key - The key of the file in the Phaser.Cache that this video will use.
427+
* @return {Phaser.Video} The newly created Video object.
428+
*/
429+
video: function (key) {
430+
431+
return new Phaser.Video(this.game, key);
432+
433+
},
434+
418435
/**
419436
* Create a BitmapData object.
420437
*

0 commit comments

Comments
 (0)