<ActorFrame><children>
	<!--

		---------------------------------------
		ONLY EDIT IF YOU KNOW WHAT IS GOING ON.
		---------------------------------------

	-->
	<Layer
		File="@ThemeFile('CS_Global/Face 6x5')"
		InitCommand="%function(self)
		self:x(SCREEN_CENTER_X-170)
		self:y(SCREEN_BOTTOM-75)
		self:SetTextureFiltering(false)
		self:zoom(2)
		self:animate(0)
		self:queuecommand('StartImageTween')
		end"
		StartImageTweenCommand="%function(self)
		self:cropright(1)
		self:linear(0.02)
		self:cropright(0)

		local TextData = CaveStoryTextBank[TextBankData1][TextBankData2]
		
		if CaveStoryTextBank[TextBankData1][TextBankData2].FaceID ~= nil then
			self:setstate( CaveStoryTextBank[TextBankData1][TextBankData2].FaceID )
			self:diffusealpha(1)
		else
			self:diffusealpha(0)
		end

		TotalSleepTime = 0
		if TextData.RequestForNewText == true then

			local TextData = CaveStoryTextBank[TextBankData1][TextBankData2]

			if TextData.Time1 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Time1 end
			if TextData.Sleep1 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Sleep1 end
			if TextData.Time2 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Time2 end
			if TextData.Sleep2 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Sleep2 end
			if TextData.Time3 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Time3 end
			if TextData.Sleep3 ~= nil then TotalSleepTime = TotalSleepTime + TextData.Sleep3 end

			self:sleep( TotalSleepTime + TextData.SleepTimeBeforeNewText )
			self:queuecommand('UpdateImage')
		end

		end"
		UpdateImageCommand="%function(self)
			self:queuecommand('StartImageTween')
		end"
		HideTextBoxMessageCommand="%function(self) self:hidden(1) end"
		/>

	<Layer
		Font="Common Normal"
		Text="Dialog"
		InitCommand="%function(self)
		--self:x(SCREEN_CENTER_X-110)
		self:y(SCREEN_BOTTOM-115)
		self:horizalign('left')
		self:vertalign('top')
		--self:wrapwidthpixels(500)
		self:zoom(0.6)
		self:settext( CaveStoryTextBank[TextBankData1][TextBankData2].Text )
		self:queuecommand('PlayText')
		end"
		PlayTextCommand="%function(self)
		local TextData = CaveStoryTextBank[TextBankData1][TextBankData2]

		if CaveStoryTextBank[TextBankData1][TextBankData2].FaceID ~= nil then
			self:wrapwidthpixels(500)
			self:x(SCREEN_CENTER_X-110)
		else
			self:x(SCREEN_CENTER_X-200)
			self:wrapwidthpixels(700)
		end

		if TextData.Cut1 ~= nil then self:cropright( TextData.Cut1 ) end
		if TextData.Time1 ~= nil then self:linear( TextData.Time1 ) end
		if TextData.Cut2 ~= nil then self:cropright( TextData.Cut2 ) end
		if TextData.Sleep1 ~= nil then self:sleep( TextData.Sleep1 ) end
		if TextData.Time2 ~= nil then self:linear( TextData.Time2 ) end
		if TextData.Cut3 ~= nil then self:cropright( TextData.Cut3 ) end
		if TextData.Sleep2 ~= nil then self:sleep( TextData.Sleep2 ) end
		if TextData.Cut4 ~= nil then self:cropright( TextData.Cut4 ) end
		if TextData.Time3 ~= nil then self:linear( TextData.Time3 ) end
		if TextData.Cut5 ~= nil then self:cropright( TextData.Cut5 ) end
		if TextData.Sleep3 ~= nil then self:sleep( TextData.Sleep3 ) end
		if TextData.Cut6 ~= nil then self:cropright( TextData.Cut6 ) end

		if CaveStoryTextBank[TextBankData1][TextBankData2].RequestMessage == true then
			MESSAGEMAN:Broadcast( CaveStoryTextBank[TextBankData1][TextBankData2].NewMessageName )
		end

		if TextData.RequestForNewText == true then
			self:sleep( TextData.SleepTimeBeforeNewText )
			self:queuecommand('UpdateTextString')
		end

		end"
		UpdateTextStringCommand="%function(self)
		local TextToGrab = CaveStoryTextBank[TextBankData1][TextBankData2].NewTextName
		self:settext( CaveStoryTextBank[TextBankData1][TextToGrab].Text )
		TextBankData2 = CaveStoryTextBank[TextBankData1][TextBankData2].NewTextName
		self:queuecommand('PlayText')
		end"
		HideTextBoxMessageCommand="%function(self) self:hidden(1) end"

		/>
	
</children></ActorFrame>