Skip to content

Commit 2d2c28f

Browse files
committed
prepare v1.1.3
1 parent 3ff14da commit 2d2c28f

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## Version 1.1.3 - April 2th 2018
2+
3+
### Features
4+
5+
- Added main scene pause resume buttons.
6+
7+
### Updates
8+
9+
- Update to Phaser 3.3.0
10+
- UI aligned with canvas size.
11+
12+
### Bug Fixes
13+
14+
- Fixed issue with preview button calling .start instead of .startFollow.
15+
16+
### Thanks
17+
18+
-
19+
120
## Version 1.1.0 - March 25th 2018
221

322
### Features

dist/PathBuilder.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ UI.prototype = {
265265
hide: function () {
266266
this.elements.forEach(function (element) { element.visible = false });
267267
this.scene.switchmode("normal");
268-
this.translate(0, 800, 400, this.scene.unfreeze);
268+
this.translate(0, this.scene.cameras.main.height, 400, this.scene.unfreeze);
269269
},
270270
show: function () {
271271
this.elements.forEach(function (element) { element.visible = true });
@@ -278,10 +278,9 @@ UI.prototype = {
278278
scrollX: x,
279279
scrollY: y,
280280
duration: speed,
281-
ease: "Cubic.easeOut",
282-
onComplete: callback,
283-
onCompleteParams: [this.scene]
281+
ease: "Cubic.easeOut"
284282
});
283+
this.scene.time.delayedCall(speed, callback, [], this.scene);
285284
},
286285
update: function () {
287286
this.elements.forEach(function (element) { element.update() });
@@ -510,6 +509,8 @@ Scene.prototype = {
510509

511510
this.events.emit('switchmode', this.mode);
512511

512+
this.W = this.cameras.main.width;
513+
this.H = this.cameras.main.height;
513514
this.drawmode = "CubicBezier";
514515

515516
//TODO: seperate class
@@ -542,9 +543,13 @@ Scene.prototype = {
542543
this.clearbutton = this.middle.add.text(10,100,'clear',null,null,null, this.clear,[], this);
543544
this.undobutton = this.middle.add.text(10,50,'undo',null,null,null, this.undo,[], this);
544545

545-
this.importbutton = this.middle.add.text(700, 400, 'import', null, null, null, this.import, [], this);
546-
this.exportbutton = this.middle.add.text(700, 500, 'export', null, null, null, this.export, [], this);
547-
this.previewbutton = this.middle.add.text(10, 500, 'preview', null, null, null, this.preview, [], this);
546+
this.importbutton = this.middle.add.text(this.W -100, this.H - 200, 'import', null, null, null, this.import, [], this);
547+
this.exportbutton = this.middle.add.text(this.W -100, this.H - 100, 'export', null, null, null, this.export, [], this);
548+
549+
this.pausebutton = this.middle.add.text(10, this.H - 200,'pause',null,null,null, this.freeze,[], this);
550+
this.resumebutton = this.middle.add.text(10, this.H - 150,'resume',null,null,null, this.unfreeze,[], this);
551+
552+
this.previewbutton = this.middle.add.text(10, this.H - 100, 'preview', null, null, null, this.preview, [], this);
548553

549554
this.modelabel = this.middle.add.label(100, 20, 'mode: ', null, null, null, null, this);
550555
this.drawmodelabel = this.middle.add.label(400, 20, 'curve: ' +this.drawmode, null, null, null, null, this);
@@ -573,7 +578,6 @@ Scene.prototype = {
573578
//this.cameras.main.setZoom(Math.sin(this.time.now/100000)+1);
574579
//this.middle.camera.setZoom(Math.sin(this.time.now/100000)+1);
575580
//this.top.camera.setZoom(Math.sin(this.time.now/100000)+1);
576-
577581
},
578582
setCameras: function () {
579583
this.drawpanel.camera.ignore(this.middle.elements);
@@ -772,12 +776,11 @@ Scene.prototype = {
772776
this.graphics.fillStyle(0xffffff, 1);
773777
this.path.draw(this.graphics, this.path.segments);
774778
},
775-
freeze: function (tw, s, ui) {
776-
//TODO:rewrite
777-
ui.scene.manager.scenes[0].scene.pause();
779+
freeze: function () {
780+
this.scene.manager.scenes[0].scene.pause();
778781
},
779-
unfreeze: function (tw, s, ui) {
780-
ui.scene.manager.scenes[0].scene.resume();
782+
unfreeze: function () {
783+
this.scene.manager.scenes[0].scene.resume();
781784
},
782785
import: function () {
783786
var data = this.cache.json.get('data');
@@ -838,7 +841,7 @@ var Pointer = function (ui, x, y, key, frame) {
838841
this.scene.input.on('pointerdown', function (pointer, gameObject) {
839842

840843
if (this.scene.mode == "draw" && pointer.dragState ==0) {
841-
if (gameObject.length ==0 && (pointer.x > 50 && pointer.x < 700)) {
844+
if (gameObject.length ==0 && (pointer.x > 50 && pointer.x < this.scene.W - 100)) {
842845
this.scene.place(this.scene.drawpanel, this.x, this.y);
843846
}
844847
}

dist/PathBuilder.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser3-plugin-pathbuilder",
3-
"version": "1.1.0",
3+
"version": "1.1.3",
44
"description": "Draw and edit Lines, Bezier Curves, Splines during runtime and export them for path tweens and PathFollowers in Phaser 3",
55
"main": "src/PathBuilder.js",
66
"scripts": {

0 commit comments

Comments
 (0)