class 'HPPanelBase' (Node)

function HPPanelBase:__init(panel, order)
	Node.__init(self, panel:getMainEntity(), 'HPPanelBase', order or 2)
	self.game_scene = panel.game_scene
	
	if self.CreateLoaderTable then
		local table_resource = self:CreateLoaderTable()
		LoadScene(self.main_entity, table_resource)
	end
end
-------------------------------------------------------------------------------

function HPPanelBase:__finalize()
end
-------------------------------------------------------------------------------

function HPPanelBase:addExit()
	local size = Vector2f(WSCR_W, 150)
		
	self.areaExit = CreateSpriteEntity('')
	self.areaExit:setName			( 'area_link_exit_from_hp' )
	self.areaExit:attachTo			( self.game_scene:getPlayField():getMainEntity() )
	self.areaExit:setAnimationSize	( size )
	self.areaExit:setXY				( WORK_W/2,  WORK_H - size.y/2 )
	self.areaExit:setColor			( Colorf(1, 1, 1, 0.01) )
	self.areaExit:setOrder			( 290 )
	self.areaExit:setCursorOverName	( 'CursorDown' )
	self.areaExit.onClickBegin:add	( bind(self.onCloseClicked, self) )
end
-------------------------------------------------------------------------------

function HPPanelBase:getAreaExit()
	return self.areaExit
end
-------------------------------------------------------------------------------

function HPPanelBase:onCloseClicked(target, screenFocus)
	self.game_scene:getPlayField():close()
end
-------------------------------------------------------------------------------