-
Notifications
You must be signed in to change notification settings - Fork 263
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
80b9afb
commit 25b4a01
Showing
10 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
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
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
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,14 @@ | ||
var WorldXYToChess = function (x, y, out) { | ||
var grid = this.grid; | ||
grid.saveOrigin(); | ||
grid.setOriginPosition(this.x, this.y); | ||
var tileXY = this.board.worldXYToTileXY(x, y, true); | ||
var tileX = tileXY.x, | ||
tileY = tileXY.y; | ||
grid.restoreOrigin(); | ||
|
||
var gameObjects = this.board.tileXYToChessArray(tileX, tileY, out); | ||
return gameObjects; | ||
} | ||
|
||
export default WorldXYToChess; |
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.
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,16 @@ | ||
const SetSizeBase = Phaser.GameObjects.Components.Size.setSize; | ||
const SetOriginBase = Phaser.GameObjects.Components.Origin.setOrigin; | ||
|
||
var SetSizeFromBounds = function () { | ||
var bounds = this.getBounds(true); | ||
|
||
SetSizeBase.call(this, bounds.width, bounds.height); | ||
|
||
var originX = (bounds.width === 0) ? 0.5 : (this.x - bounds.left) / bounds.width; | ||
var originY = (bounds.height === 0) ? 0.5 : (this.y - bounds.top) / bounds.height; | ||
SetOriginBase.call(this, originX, originY); | ||
|
||
return this; | ||
} | ||
|
||
export default SetSizeFromBounds; |
This file was deleted.
Oops, something went wrong.