Canvases are useful for manipulating many UI elements at once.
After defining a canvas, go to the place where you want the UI elements to be drawn, and push the canvas:
function draw()
...
mgPushCanvas(beautifulCanvas)
...
end
Then, draw all the elements belonging to that canvas and pop the canvas:
mgPushCanvas(beautifulCanvas)
mgDraw(niceText)
mgDraw(perfectUi)
mgDraw(coolImage)
mgPopCanvas()
Now you can manipulate all of the elements belonging to the canvas by manipulating the canvas:
mgSetScale(beautifulCanvas,0.5,0.5) - Sets the scale of all elements belonging to the beautifulCanvas to 0.5 by 0.5.
Making a menu
Custom text display