function OnSceneLoad(screen)
    LoadData(screen)
    
    game_state.text = {}
    local text_1 = CreateTextCommunication(screen, 'COMICS_11_COMMUNICATION_1')
    table.insert(game_state.text, text_1)
    local text_2 = CreateTextCommunication(screen, 'COMICS_11_COMMUNICATION_2')
    text_2:SetOpacity(0)
    table.insert(game_state.text, text_2)
    local text_3 = CreateTextCommunication(screen, 'COMICS_11_COMMUNICATION_3')
    text_3:SetOpacity(0)
    table.insert(game_state.text, text_3)
end

function CreateTextCommunication(screen, text)
    local text_title = CreateTextEntity('Arial18', GetString(text))
    text_title:AttachTo( screen )
	text_title:SetScale(1)
	text_title:SetZ(500)
	text_title:SetXY(410, 270)
	text_title:SetBorderSize(360, 170)
	text_title:SetColor(4294967295)
	text_title:SetTextAlignment(HGETEXT_TOP + HGETEXT_LEFT)
	
	return text_title;
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown()
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
end

function OnLose()
end

function OnExit()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    local text_1 = game_state.text[1]
    if text_1 and text_1:GetScrOpacity() == 1. then
       text_1:ChangeOpacity(1, 0, 0.3)
       table.remove(game_state.text, 1)
       local next = game_state.text[1]   
       if next then
            next:ChangeOpacity(0, 1, 0.3)
       else
            FinishComics(true)
       end
    end   
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
end

function OnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object);
end

function OnObjectReachPanel(object)
end

function OnPhotographing()
	DefaultOnPhotographing();
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function OnMinigameCompleted()
end

function OnLostFocus()
end

function OnGainFocus()
end

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_shadow',anim,613,384,150,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/palm_big.png',0,0,543,284,1,0)
	anim:SetHotSpot(271,142)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('palm_big',anim,610,356,150,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
