Animation Mac vs Win

Still hitting a few roadblocks trying to get a comparable version of my app on Windows. Put simply there is a full screen canvas where a path is drawn with graphics path for an object. There are 2 other canvases that are on top each having a 2 picture animations. These 2 canvases are moved with separate timers at different rate (100 & 200ms) that also check for collisions with the path.

This perhaps clunky approach looks really smooth on Mac but on Windows 10 via Parallels its slow and noticeably not smooth.

A better approach…?

IMHO, I would suggest doing it in one canvas on Windows. The Mac uses some complex view caching which will help keep animation smooth (at the expense of RAM), whereas the last time I used Windows, it didn’t and overlapping controls caused multiple refreshes.

When doing it in a single canvas, make sure you only invalidate the area that your items were at and are now at. Since macBS you can no longer use the rects from the Paint event to know which areas have been updated.

This undocumented change is the correct behavior according to some reports from the interwebs, so you’ll need to roll your own solution for managing which areas need repainting.

Hmm I was afraid someone was going to say that, thanks Sam.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.