gre.dump resource

gre.dump_resource(
    pool_name,
    resource_name
)
		    

This function performs the opposite of the gre.load_resource call and removes a resource from the specified resource pool cache.

This call can only be made from the main Lua action execution thread.

Parameters: pool_name The name of the resource pool: image or font resource_name The name of the resource that is to be removed Example:

-- Force the tree.jpg image out of the cache, image will reload as required
function flush_tree_image()
    gre.dump_resource("image", "images/tree.jpg")
end

function flush_fonts()
   gre.dump_resource("font", "fonts/DejaVu.ttf:18") -- removes a single font size from this font
   gre.dump_resource("font", "fonts/Roboto-Black.ttf") -- removes every sizes from this font
end
Was this article helpful?
0 out of 0 found this helpful