-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d18fa52
commit 311ddc9
Showing
19 changed files
with
64 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
set main=./examples/lineshape/line-type.js | ||
cd .. | ||
cd .. | ||
npm run dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
plugins/gameobjects/shape/curve/Factory.js → plugins/gameobjects/shape/line/Factory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import Curve from './Curve.js'; | ||
import Line from './Line.js'; | ||
|
||
export default function (points, lineWidth, color, alpha, lineType) { | ||
var gameObject = new Curve(this.scene, points, lineWidth, color, alpha, lineType); | ||
var gameObject = new Line(this.scene, points, lineWidth, color, alpha, lineType); | ||
this.scene.add.existing(gameObject); | ||
return gameObject; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...jects/shape/curve/methods/DrawPolyLine.js → ...bjects/shape/line/methods/DrawPolyLine.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
var DrawPolyLine = function (lines) { | ||
var DrawPolyLine = function (line) { | ||
var points = this.points; | ||
var startPoint = points[0]; | ||
var startX = startPoint.x; | ||
var startY = startPoint.y; | ||
lines.startAt(0, 0); | ||
line.startAt(0, 0); | ||
|
||
for (var i = 1, cnt = points.length; i < cnt; i++) { | ||
var point = points[i]; | ||
var x = point.x - startX; | ||
var y = point.y - startY; | ||
lines.lineTo(x, y); | ||
line.lineTo(x, y); | ||
} | ||
|
||
lines.end(); | ||
line.end(); | ||
} | ||
|
||
export default DrawPolyLine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Factory from './gameobjects/shape/line/Factory.js'; | ||
import Creator from './gameobjects/shape/line/Creator.js'; | ||
import Line from './gameobjects/shape/line/Line.js'; | ||
import SetValue from './utils/object/SetValue.js'; | ||
|
||
class LinePlugin extends Phaser.Plugins.BasePlugin { | ||
|
||
constructor(pluginManager) { | ||
super(pluginManager); | ||
|
||
// Register our new Game Object type | ||
pluginManager.registerGameObject('rexLineShape', Factory, Creator); | ||
} | ||
|
||
start() { | ||
var eventEmitter = this.game.events; | ||
eventEmitter.on('destroy', this.destroy, this); | ||
} | ||
} | ||
|
||
SetValue(window, 'RexPlugins.GameObjects.LineShape', Line); | ||
|
||
export default LinePlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Line from './gameobjects/shape/line/Line.js'; | ||
export default Line; |