Skip to content

Commit 1c41681

Browse files
committed
Next frame button
1 parent 71743b4 commit 1c41681

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Phaser.Plugin.Inspector = class Inspector extends Phaser.Plugin {
4141
.controller('TreeCtrl', TreeCtrl)
4242
.controller('ViewCtrl', ViewCtrl)
4343
.controller('DetailCtrl', DetailCtrl)
44-
.factory('gameManager', ($timeout) => new GameManager($timeout, this.game))
44+
.factory('gameManager', ($timeout) => new GameManager($timeout, this.game, this.onUpdate))
4545
.directive('phaserInspectorPanel', interaction)
4646
.directive('phaserInspectorTree', phaserInspectorTree)
4747
.directive('phaserInspectorDetails', phaserInspectorDetails)

src/js/services/GameManager.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ function match(childObj, term){
88
return (name && name.toLowerCase().match(term)) || (type && type.toLowerCase().match(term));
99
}
1010

11+
var min = Math.min,
12+
max = Math.max;
13+
1114
export default class GameManager {
12-
constructor($timeout, game){
15+
constructor($timeout, game, onUpdate){
1316
this.$timeout = $timeout;
1417
this.game = game;
18+
this.onUpdate = onUpdate;
1519

1620
this.filteredWorld = { children: [] };
1721
this.filterTimer = null;

src/tpl/tree.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
</div>
3535
<div class="button"
3636
ng-class="{
37-
success : treeCtrl.game.paused,
38-
danger : !treeCtrl.game.paused
37+
success : treeCtrl.game.paused,
38+
danger : !treeCtrl.game.paused
3939
}"
4040
tooltip-trigger tooltip-text="Play/Pause"
4141
ng-click="treeCtrl.game.paused = !treeCtrl.game.paused"
@@ -45,6 +45,12 @@
4545
'fa-pause' : !treeCtrl.game.paused
4646
}"></i>
4747
</div>
48+
<div class="button warn"
49+
tooltip-trigger tooltip-text="Next Frame"
50+
ng-click="treeCtrl.gameManager.nextFrame()"
51+
>
52+
<i class="fa fa-forward"></i>
53+
</div>
4854
</div>
4955

5056
<div class="scene">

0 commit comments

Comments
 (0)