function OnSceneLoad(screen)
    LoadData(screen)

    dialog = screen
    dialog:SetAllowInput(true)
    
    local x = 691
    local y = 372
    local width = 569
    local height = 405
    
    local credits_entity = CreateCreditsText()
    credits_entity:AttachTo(screen)
    credits_entity:SetZ(180)
    credits_entity:SetTextPosXY(x, y)
    credits_entity:SetClippingRect(x - width/2, y - height/2, width, height - 70)
    
    local bttn_ok = create_button_ex(screen, 'data/Texture/GUI/Button/bttn_ok.png', 'Ok', 686, 533, 180)
    bttn_ok:SetHotKey(HGEK_ESCAPE)

    OnButtonPress('')
    PlaySound("opening_window")
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 OnButtonMouseEnter(title)
end

function OnButtonMouseLeave(title)
end

function OnObjectMouseDown(object)
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
    
    if title == 'Ok' then
        local current_screen = GetGameManager():GetCurrentScreen()
        
        current_screen:SetAllowInput(false)
        current_screen:ScreenDestroy()
        
        if menu then
            menu:SetAllowInput(true)
            menu:Go()
        end 
    end
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',anim,511,387,70,0,128,96)
	local anim = CreateAnimation('data/Texture/Screen/CreditsScreen/CreditsScreen.png',0,0,610,469,1,0)
	anim:SetHotSpot(305,234)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('CreditsScreen',anim,690,372,300,0,1,1)
	local anim = CreateAnimation('data/Texture/Screen/CreditsScreen/CreditsScreenBackground.png',0,0,569,405,1,0)
	anim:SetHotSpot(284,202)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('CreditsScreenBackground',anim,691,372,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Button/bttn_back.png',0,0,185,72,1,0)
	anim:SetHotSpot(92,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bttn_back',anim,681,538,150,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
