package  
{
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Spritemap;
	import net.flashpunk.FP;
	/**
	 * ...
	 * @author AntoineGuerchais
	 */
	public class Clipper extends Entity
	{
		[Embed(source = '../assets/graphics/pointer.png')]
		private const ClipperImage:Class;
		
		private var mouseImage:Spritemap;
		
		static public var over:Boolean;
		private var overState:Boolean;
		
		public function Clipper() 
		{
			graphic = mouseImage = new Spritemap(ClipperImage, 32, 32);
			mouseImage.originX = 32 * 0.5;
			layer = -10;
		}
		
		override public function update():void
		{
			overState = false;
			if (over) mouseImage.frame = 0;
			else mouseImage.frame = 1;
			mouseImage.update();
			x = FP.screen.mouseX;
			y = FP.screen.mouseY;
		}
		
		override public function render():void
		{
			super.render();
			over=overState
		}
	}

}