clearGraphics() Function Reference

clearGraphics()

Clears the current render ready to redraw, or just because you no longer need the output. You'd usually want to call qiso.deactivate() and then this to clear the screen for something else, and then qiso.activate() to resume.


	local qiso = require "plugin.qisoengine"
	qiso.setAssetsFolder("assets")
	qiso.loadTiledMap("sample-tilemap")

	-- Enable camera panning when the screen is dragged
	qiso.enableCameraPan()

	-- Enable the main Qiso loop to render/update our world
	qiso.activate()

	local gamePaused = false

	-- Pause and clear, or resume on tap.
	function tapScreen(event)
		if(gamePaused) then
			qiso.activate()
			gamePaused = false
		else
			qiso.deactivate()
			qiso.clearGraphics()
			gamePaused = true
		end
	end

	Runtime:addEventListener('tap', tapScreen)