Igis Snippet: Clearing the Canvas Every Frame

From Coder Merlin
Revision as of 20:52, 26 January 2020 by Yarsenius (talk | contribs) (Created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder


override func render(canvas:Canvas) {
    if let canvasSize = canvas.canvasSize {
        let canvasRect = Rect(topLeft:Point(), size:canvasSize)
        let canvasClearRectangle = Rectangle(rect:canvasRect, fillMode:.clear)
        canvas.render(canvasClearRectangle)
    }
}
CoderMerlin™ proudly recommends: