Skip to content

Commit

Permalink
Merge pull request #30 from PhaserEditor2D/release-3.1.0
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
PhaserEditor2D authored May 25, 2020
2 parents 4b59105 + 0539d23 commit eb7e800
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 44 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Change Log

## Version 3.1.0 - today
## Version 3.1.0 - May 24, 2020

### Added

* Scene Editor: use a color picker for the color properties in the Inspector view.
* Scene Editor: the origin manipulator. To select it press `O` or select it in the context menu or toolbar. It also support containers.
* Scene Editor: the Tint properties.
* Scene Editor: two scopes for transformations: local and global. You can select it in the context menu (Coords -> Global). Default is local.
* Server: shows helpful welcome messages.

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,55 +172,14 @@ namespace phasereditor2d.scene.ui.sceneobjects {

getPoint(args: editor.tools.ISceneToolContextArgs) {

const container = args.objects[0] as Container;

const point = new Phaser.Math.Vector2();

container.getWorldTransformMatrix().transformPoint(0, 0, point);

const { x, y } = args.camera.getScreenPoint(point.x, point.y);

return {
x: this._axis === "x" ? x + 100 : x,
y: this._axis === "y" ? y + 100 : y
};
return this.getSimpleTranslationPoint(this._axis, args);
}

render(args: editor.tools.ISceneToolRenderArgs) {

const { x, y } = this.getPoint(args);

const ctx = args.canvasContext;

ctx.strokeStyle = "#000";

if (this._axis === "xy") {

ctx.save();

ctx.translate(x, y);

this.drawCircle(ctx,
args.canEdit ? "#fff" : editor.tools.SceneTool.COLOR_CANNOT_EDIT);

ctx.restore();

} else {

ctx.save();

ctx.translate(x, y);

if (this._axis === "y") {

ctx.rotate(Math.PI / 2);
}

this.drawArrowPath(ctx,
args.canEdit ? (this._axis === "x" ? "#f00" : "#0f0") : editor.tools.SceneTool.COLOR_CANNOT_EDIT);

ctx.restore();
}
this.renderSimpleAxis(this._axis, x, y, "#fff", args);
}
}
}

0 comments on commit eb7e800

Please sign in to comment.