class 'l_CreditsScreen' (BaseScreen)

function l_CreditsScreen:__init(name, screen)
	BaseScreen.__init(self, name, screen)

    -- create button
	do
	    local bttn_ok = self:CreateButton('bttn_ok')
	    bttn_ok:SetAction('OnOkButtonOKScreen', self)
	    bttn_ok:SetActionSound('Menu_button_click')
	    bttn_ok:SetKeyEquivalent(KEY_ENTER)
	end
	
	local width        = 500
	local height       = 380
	local y_correction = 31
	
	local credits_entity = CreateCreditsText()
    credits_entity:AttachTo(screen)
    credits_entity:SetZ(120)
    credits_entity:SetScale(0.7)
    credits_entity:SetRect(512 - width/2, 342 - height/2 + y_correction, width, height)
    credits_entity:SetOnCenter()
end

function l_CreditsScreen:OnUpdate(dt)
end

function l_CreditsScreen:OnObjectMouseEnter(object)
end

function l_CreditsScreen:OnObjectMouseLeave(object)
end

function l_CreditsScreen:OnScreenObjectMouseDown(object)
end

function l_CreditsScreen:OnObjectMouseDownProcessed(is_wrong_click)
end

function l_CreditsScreen:OnObjectMouseUp(object)
end

function l_CreditsScreen:OnButtonPress(title)
end

function l_CreditsScreen:OnMouseMove(previous_pos, current_pos)
end

function l_CreditsScreen:OnSetTool(tool)
end

function l_CreditsScreen:OnLoaded()
end

function l_CreditsScreen:OnDestroy()
end

--------------------------------------------------------------------------------
function CreateCreditsScreen(hideActiveScreen)
    hideActiveScreen = (hideActiveScreen == nil) and true or hideActiveScreen
    
    local screen = CreateScriptedScreen('data/Scripts/screens/CreditsScreen.lua', 'l_CreditsScreen')
    PopUpScreensMgr:Push(screen, hideActiveScreen, nil)
end
--------------------------------------------------------------------------------
function l_CreditsScreen:OnOkButtonOKScreen()
    PopUpScreensMgr:Pop()
    
    local prevScreen = PopUpScreensMgr:GetTop()
    
    if prevScreen and prevScreen:GetName() == 'l_MoreInfoScreen' then
        PopUpScreensMgr:Pop()
    end
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function l_CreditsScreen:LoadData(screen)
	local anim
	anim = CreateAnimation('data/Texture/GUI/OK/WindowOK.png',0,0,580,450,1,0)
	anim:SetHotSpot(290,225)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BackgroundCredits',anim,512,384,110,0,1,1)
	
	anim = CreateAnimation('data/Texture/GUI/Buttons/bttn_ok.png',0,0,162,104,3,0)
	anim:SetHotSpot(81,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bttn_ok',anim,512,583,150,0,1,1)
	
end
-- CLEAR_ON_SAVE_END
