/**
 * Hilo 1.6.0 for amd
 * Copyright 2016 alibaba.com
 * Licensed under the MIT License
 */
define("hilo/game/Camera",["hilo/core/Class","hilo/util/util"],function(t,i){var h=t.create({constructor:function(t){this.width=0,this.height=0,this.target=null,this.deadzone=null,this.bounds=null,this.scroll={x:0,y:0},i.copy(this,t)},tick:function(t){var i=this.target,h=this.scroll,a=this.bounds,s=this.deadzone;if(i){var n,e;s?(n=Math.min(Math.max(i.x-h.x,s[0]),s[0]+s[2]),e=Math.min(Math.max(i.y-h.y,s[1]),s[1]+s[3])):(n=.5*this.width,e=.5*this.height),h.x=i.x-n,h.y=i.y-e,a&&(h.x=Math.min(Math.max(h.x,a[0]),a[0]+a[2]),h.y=Math.min(Math.max(h.y,a[1]),a[1]+a[3]))}else h.x=0,h.y=0},follow:function(t,i){this.target=t,void 0!==i&&(this.deadzone=i),this.tick()}});return h});