
.namespace PastilleHardToFind

function StartSequence()
	OPLog.Log("startsequence "..self.Name)
	--self.spritefade.Flags_Visible = true
	self.compteurfade = NBFADEHIGHLIGHT
	self.curfadeout = true
	self.refpos = Vector:new(self)
	
	SpriteZoom.Zoom(self,2,1,self,self.refpos)
	--SpriteFader.Fade(self.spritefade,self.curfadeout,FADEHIGHTLIGHTLENGTH,self)
	
	--on fade dans l'autre sens, ca sera plus marqué
	--SpriteFader.Fade(self,not self.curfadeout,FADEHIGHTLIGHTLENGTH)
end

function OnFaderEnd()
	self.compteurfade = self.compteurfade -1	
	if self.compteurfade >=0 then
		self.curfadeout = not self.curfadeout
		SpriteFader.Fade(self.spritefade,self.curfadeout,FADEHIGHTLIGHTLENGTH,self)
		SpriteFader.Fade(self,not self.curfadeout,FADEHIGHTLIGHTLENGTH)
	else
		self.spritefade.Flags_Visible = false
		self.Color.a = 255
		
	end
end

function OnZoomEnd()
	--OPLog.Log("onzoomend "..self.compteurfade.." "..self.Name)
	self.compteurfade = self.compteurfade -1	
	if self.compteurfade >= 0  then
		--SpriteFader.Fade(self.spritefade,self.curfadeout,FADEHIGHTLIGHTLENGTH,self)
		
		if self.Scale_X > 1.1 then
			SpriteZoom.Zoom(self,1,1,self,self.refpos)
		else
			SpriteZoom.Zoom(self,2,1,self,self.refpos)
		end		
	else
		self.Scale_X = 1
		self.Scale_Y = 1				
	end
end




