Skip to content

Commit

Permalink
Revelvant entries made in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman committed May 7, 2018
1 parent 50d0f6f commit f4fd44a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased

## Breaking Changes
- Property scope `Pointer.actorsUnderPointer` changed to private;

-Property scope `Pointer.actorsUnderPointer` changed to private;

## Added
- New `PointerEvent.stopPropagation()` method added. Works the same way as (https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation)

-New `PointerEvent.stopPropagation()` method added. Works the same way as (`https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation`)
([#912](https://github.com/excaliburjs/Excalibur/issues/912))
- New abstract Class `BubblingEvent` which extends `GameEvent` and provides event with bubbling functionality
- New `Actor.getAncestors()` method, which retreives full array of current Actors` ancestors
-New `Actor.getAncestors()` method, which retreives full array of current Actor ancestors

## Changed
- `CapturePointer.update()` method now doesn't propagate event to actor, just verifies pointer events for actor.

-`CapturePointer.update()` method now doesn't propagate event to actor, just verifies pointer events for actor.

<!----------------------------------------------------------------------------------------------->

Expand Down
26 changes: 13 additions & 13 deletions sandbox/tests/zoom/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@ raptorAnim.loop = true;

game.isDebug = true;

var target = new ex.Actor(game.halfDrawWidth, game.halfDrawHeight, 64*2, 64*2, ex.Color.Red.clone());
target.addDrawing("default", raptorAnim);
var target = new ex.Actor(game.halfDrawWidth, game.halfDrawHeight, 64 * 2, 64 * 2, ex.Color.Red.clone());
target.addDrawing('default', raptorAnim);

var currentZoom = 1.0;

document.addEventListener('mousedown', (ev: MouseEvent) => {
console.log(game.screenToWorldCoordinates(new ex.Vector(ev.offsetX, ev.offsetY)));
});

target.on('pointerdown',(ev: ex.Input.PointerEvent) => {
target.on('pointerdown', (ev: ex.Input.PointerEvent) => {

target.color = ex.Color.Green.clone();
});

target.on('pointerup',(ev: PointerEvent) => {
target.on('pointerup', (ev: ex.Input.PointerEvent) => {
target.color = ex.Color.Red.clone();
});

game.add(target);

game.input.keyboard.on('down', (ev: ex.Input.KeyEvent) => {
if (ev.key == 107 /* + */) {
game.currentScene.camera.zoom(currentZoom+=.03);
if (ev.key === 107 /* + */) {
game.currentScene.camera.zoom(currentZoom += .03);
}
if (ev.key == 109 /* - */) {
game.currentScene.camera.zoom(currentZoom-=.03);
if (ev.key === 109 /* - */) {
game.currentScene.camera.zoom(currentZoom -= .03);
}

var currentFocus = game.currentScene.camera.getFocus();
if (ev.key == ex.Input.Keys.Left) {
if (ev.key === ex.Input.Keys.Left) {
game.currentScene.camera.x = currentFocus.x - 10;
}
if (ev.key == ex.Input.Keys.Right) {
if (ev.key === ex.Input.Keys.Right) {
game.currentScene.camera.x = currentFocus.x + 10;
}
if (ev.key == ex.Input.Keys.Up) {
if (ev.key === ex.Input.Keys.Up) {
game.currentScene.camera.y = currentFocus.y - 10;
}
if (ev.key == ex.Input.Keys.Down) {
if (ev.key === ex.Input.Keys.Down) {
game.currentScene.camera.y = currentFocus.y + 10;
}

Expand Down

0 comments on commit f4fd44a

Please sign in to comment.