mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Add camera zoomTo(pos)
This commit is contained in:
parent
7ea9260322
commit
a092557973
2 changed files with 5 additions and 1 deletions
app/lib/surface
|
@ -42,6 +42,7 @@ module.exports = class Camera extends CocoClass
|
|||
'level:restarted': 'onLevelRestarted'
|
||||
'sprite:mouse-down': 'onMouseDown'
|
||||
'sprite:dragged': 'onMouseDragged'
|
||||
'camera-zoom-to': 'onZoomTo'
|
||||
|
||||
# TODO: Fix tests to not use mainLayer
|
||||
constructor: (@canvasWidth, @canvasHeight, angle=Math.asin(0.75), hFOV=d2r(30)) ->
|
||||
|
@ -308,3 +309,6 @@ module.exports = class Camera extends CocoClass
|
|||
createjs.Tween.removeTweens @
|
||||
@finishTween = null
|
||||
super()
|
||||
|
||||
onZoomTo: (pos, time) ->
|
||||
@zoomTo(@worldToSurface(pos), @zoom, time)
|
||||
|
|
|
@ -231,7 +231,7 @@ module.exports = class WizardSprite extends IndieSprite
|
|||
super() if @displayObject.visible # not if we hid the wiz
|
||||
|
||||
moveWizard : (x, y) =>
|
||||
console.log x, y
|
||||
position = {x: @targetPos.x+x, y: @targetPos.y+y}
|
||||
@setTarget(position, 500, true)
|
||||
@updatePosition()
|
||||
Backbone.Mediator.publish 'camera-zoom-to', position, 500
|
Loading…
Add table
Add a link
Reference in a new issue