-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #800 ## Changes: - Implement missing camera zoom over time - Zoom now returns a promise on completion - Visual test demonstrating zoom - Unit test validating zoom over time
- Loading branch information
Showing
9 changed files
with
112 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Camera Zooom</title> | ||
</head> | ||
<body> | ||
<canvas id="game"></canvas> | ||
<script src="../../Excalibur.js"></script> | ||
<script src="zoom.js"></script> | ||
<p>Click to zoom in and out over time</p> | ||
</body> | ||
</html> |
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,32 @@ | ||
/// <reference path='../../excalibur.d.ts' /> | ||
|
||
var game = new ex.Engine({ | ||
width: 500, | ||
height: 500 | ||
}); | ||
|
||
game.backgroundColor = ex.Color.Blue; | ||
|
||
|
||
var actor = new ex.Actor(); | ||
|
||
actor.pos.x = 250; | ||
actor.setWidth(10); | ||
actor.pos.y = 250; | ||
actor.setHeight(10); | ||
actor.color = ex.Color.Red; | ||
|
||
game.add(actor); | ||
|
||
var zoomedIn = false; | ||
game.input.pointers.primary.on('down', (evt: ex.Input.PointerEvent) => { | ||
if (!zoomedIn) { | ||
zoomedIn = true; | ||
game.currentScene.camera.zoom(5, 1000); | ||
} else { | ||
zoomedIn = false; | ||
game.currentScene.camera.zoom(.2, 1000); | ||
} | ||
}); | ||
|
||
game.start(); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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