class 'SplashScreen' (BaseScreen)

function SplashScreen:__init(name)
	BaseScreen.__init(self, name)
	
	self.dt = 0
	
	local function open(entity, state)
		if state then
			self:onScreenDestroy()
		end
	end
	self:getMainEntity():setHandlingChildEvents(true)
	self:getMainEntity().onClickBegin:add( bind(self.onScreenDestroy, self) )
end

function SplashScreen:__finalize()
end

function SplashScreen:onUpdate(dt)
	self.dt = self.dt + dt
	if self.dt > 3 then
		self:onScreenDestroy()
	end
end

function SplashScreen:setBackground(path_texture)
	local sprite_bg = CreateSpriteEntityInstant(path_texture)
	sprite_bg:attachTo( self:getMainEntity() )
	sprite_bg:setScrXY(SCR_W/2, SCR_H/2)
	sprite_bg:setHotSpot(SCR_W/2, SCR_H/2)
end

function SplashScreen:setCallback(callback)
	self.callback = callback
end

function SplashScreen:onScreenDestroy()
	PopUpScreensMgr:pop()
	if self.callback then
		self.callback()
	end
end

--------------------------------------------------------------------------------
--                      GENERATED CONTENT. DO NOT EDIT.                       --
--------------------------------------------------------------------------------

function SplashScreen:CreateLoaderTable()
	local objects =
	{
	}
	return objects
end
