Igis Snippet: Clearing the Canvas Every Frame

From Coder Merlin
Jump to navigation Jump to search
func clearCanvas(canvas:Canvas) {
    if let canvasSize = canvas.canvasSize {
        let canvasRect = Rect(topLeft:Point(), size:canvasSize)
        let canvasClearRectangle = Rectangle(rect:canvasRect, fillMode:.clear)
        canvas.render(canvasClearRectangle)
    }
}

override func render(canvas:Canvas) {
    clearCanvas(canvas:canvas)
}


CoderMerlin™ proudly recommends:
HintIcon.png

Your purchase via these links helps keep  Coder Merlin™ 's orbuculum ablaze. As an Amazon Associate we earn from qualifying purchases. Thank you for your support!


Designed with pride in Silicon Valley, CA, USA