class 'l_09_Andreas_house_Z_Comics_Father_1' (ZoomZone)

function l_09_Andreas_house_Z_Comics_Father_1:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)

	-- some thing ---------------------------------------------------------
	do
		local function on_something(event)
			self:closeAndDisable()
		end		
	end
	-----------------------------------------------------------------------
	self.progress_bar_obj = self:getEntityNamed('progress_bar')
	self.bar_fill_time = 2
	self.bar_fill_part = 1
	
	self.progress_bar_obj:setScissorBox(-300,-16,-300,16)
	
	self:getMainEntity().onUpdate:add( function(obj,dt)
		self:onUpdate(dt)
	end )

end

function l_09_Andreas_house_Z_Comics_Father_1:onOpen()
    self.mouseBlocker:push()

    self.bar_fill_part = 0

    self.timer:add(function()
            self.mouseBlocker:pop()
            self:getEntityNamed('sending_photo_anchor'):setVisible(false)
    
            -- local father_comics = self.playfield:createComics('Father_1', ComicsTypes.PHONE)
            local on_finish = function()            		
            		--self.playfield:entityShow('area_find_treasure_note')
                    self:close()
                end
            on_finish()
            -- father_comics:start()
        end, self.bar_fill_time)
end

function l_09_Andreas_house_Z_Comics_Father_1:onUpdate(dt)           
    if self.bar_fill_part < 1 then
        Console:pushText(self.bar_fill_part and ''..self.bar_fill_part or 'nil')
        self.bar_fill_part = self.bar_fill_part + dt/self.bar_fill_time
        self.bar_fill_part = self.bar_fill_part<=1 and self.bar_fill_part or 1
        
        self.progress_bar_obj:setScissorBox(-300, -16, -300+600*self.bar_fill_part, 16)
    end
end


   


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

function l_09_Andreas_house_Z_Comics_Father_1:CreateLoaderTable()
	local objects =
	{
		{ name = 'sending_photo_anchor',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  isRespondable = false,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 100,  height = 100,  },
		{ name = 'display_big',  entityType = 'SpriteEntity',  parentName = 'sending_photo_anchor',  x = 0,  y = 0,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Comics_Father_1/display_big.png',  width = 994,  height = 568,  },
		{ name = 'preview',  entityType = 'SpriteEntity',  parentName = 'sending_photo_anchor',  x = 0,  y = -55,  order = 0,  scale = 1.5,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Comics_Father_1/preview.png',  width = 250,  height = 188,  },
		{ name = 'progress_bar_cover',  entityType = 'SpriteEntity',  parentName = 'sending_photo_anchor',  x = 0,  y = 156,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Comics_Father_1/progress_bar_cover.png',  width = 630,  height = 62,  },
		{ name = 'progress_bar',  entityType = 'SpriteEntity',  parentName = 'progress_bar_cover',  x = 0,  y = 0,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Comics_Father_1/progress_bar.png',  width = 600,  height = 32,  },
	}
	return objects
end
