function OnSceneLoad(screen)
    LoadData(screen)
    
    local phone = play_field:GetLevelScreen():GetPhone()
    phone:SetVisibleTool()

    local tutorial = TutorialScreen:New(screen, 'COMICS_1_BOOTH_USE_KEY')
    tutorial:SetPos(600, 200)
    
    local arrow = screen:GetObject('TutorialArrow_SetTool') 
    arrow:SetLayer(phone:GetLayer() + 1)
    local af = CreateAnimationEffector()
    af:AttachTo( arrow )
    af:SetMode(_ANIM_LOOP)
    af:SetKey(_TRACK_X, 0.0, arrow:GetX())
    af:SetKey(_TRACK_Y, 0.0, arrow:GetY())
    af:SetKey(_TRACK_X, 0.5, arrow:GetX() + 25)
    af:SetKey(_TRACK_Y, 0.5, arrow:GetY() - 0)
    af:SetKey(_TRACK_X, 1.0, arrow:GetX())
    af:SetKey(_TRACK_Y, 1.0, arrow:GetY())
    af:Play()
    
    local arrow = screen:GetObject('TutorialArrow')
    arrow:SetOpacity(0)
    local af = CreateAnimationEffector()
    af:AttachTo( arrow )
    af:SetMode(_ANIM_LOOP)
    af:SetKey(_TRACK_X, 0.0, arrow:GetX())
    af:SetKey(_TRACK_Y, 0.0, arrow:GetY())
    af:SetKey(_TRACK_X, 0.5, arrow:GetX() + 0)
    af:SetKey(_TRACK_Y, 0.5, arrow:GetY() - 25)
    af:SetKey(_TRACK_X, 1.0, arrow:GetX())
    af:SetKey(_TRACK_Y, 1.0, arrow:GetY())
    af:Play()
    
    screen:GetObject('bg'):SetVisible(false)
    
    local key = screen:GetObject('key')
    key:SetOpacity(0)
    key:SetLayer(phone:GetLayer() + 1)
    screen:IgnoreOnTestPoint('key')
    
    custom_cursors['pixel_use_key'] = GetCursorArms()
    
    local left_bttn_pos = Vector(50, 348)
    local right_bttn_pos = Vector(159, 348)
    
    create_button(screen, 'list_left_up', 'list_left_over', 'list_left_down', 'left', left_bttn_pos.x, left_bttn_pos.y, 1500)
    create_button(screen, 'list_right_up', 'list_right_over', 'list_right_down', 'Right', right_bttn_pos.x, right_bttn_pos.y, 1500)
    screen:GetObject('list_left_maska'):SetXY(left_bttn_pos.x, left_bttn_pos.y)
    screen:GetObject('list_right_maska'):SetXY(right_bttn_pos.x, right_bttn_pos.y)

    screen_comics = screen
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown()
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
    
    if screen_comics and screen_comics:HasObject('key') then
        local key = screen_comics:GetObject('key')
        key:SetXY(GetMousePosX(), GetMousePosY())
    end        
    
    if play_field:GetTool() then
        play_field:GetTool():SetOpacity(0)
    end
end

function OnLose()
end

function OnExit()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    if object:GetName() == 'pixel_zone_inventory' then
        screen_comics:IgnoreOnTestPoint('pixel_zone_inventory')
        
        screen_comics:GetObject('key'):ChangeOpacity(0, 1, TIME_SHOW_COMICS)
        screen_comics:GetObject('TutorialArrow'):ChangeOpacity(0, 1, 0.3)
        screen_comics:GetObject('TutorialArrow_SetTool'):ChangeOpacity(1, 0, 0.3)
    end

    if object:GetName() == 'pixel_use_key' then
        local key = screen_comics:GetObject('key')
        if key and key:GetOpacity() == 1 then
            FinishComics(true)
            OnToolApply(play_field:GetObject('key'), play_field:GetObject('pixel_action_key'))
        end
    end
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
end

function OnToolFound(tool)
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/1_booth_/Layers/bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bg',anim,512,384,20,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/TutorialArrow.png',0,0,64,32,1,0)
	anim:SetHotSpot(32,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('TutorialArrow',anim,947,451,200,90,1.5,1.5)
	local anim = CreateAnimation('data/Texture/Comics/TutorialArrow.png',0,0,64,32,1,0)
	anim:SetHotSpot(32,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('TutorialArrow_SetTool',anim,210,202,200,-180,1.5,1.5)
	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,103,96)
	local anim = CreateAnimation('data/Texture/GUI/Phone/bg.png',0,0,235,526,1,0)
	anim:SetHotSpot(117,263)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_phone',anim,97,308,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Panel/bg_panel.png',0,0,218,768,1,0)
	anim:SetHotSpot(109,384)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_panel',anim,109,384,100,0,1,1)
	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_zone_inventory',anim,105,220,1000,0,22,36)
	local anim = CreateAnimation('data/Texture/Scenes/1_booth_/ZoomBucket/key.png',0,0,94,48,1,0)
	anim:SetHotSpot(47,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('key',anim,512,384,2500,0,1,1)
	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_use_key',anim,957,549,1005,0,12,10)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_left.png',0,0,40,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_left_up',anim,782,650,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_left.png',40,0,40,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_left_over',anim,782,689,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_left.png',80,0,40,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_left_down',anim,782,731,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_right.png',0,0,41,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_right_up',anim,838,647,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_right.png',41,0,41,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_right_over',anim,838,689,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_right.png',82,0,41,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('list_right_down',anim,838,733,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_left.png',0,0,40,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('list_left_maska',anim,782,650,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Phone/Button/list_right.png',0,0,41,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('list_right_maska',anim,838,647,1000,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
