Thursday, March 21, 2013

Analog Clock

This may be the most implemented first graphics object; there must be a gazillion implementations. This is mine. (Object inside an example project.) Colors and elements to be drawn can be chosen in the property editor.
Apart from borrowing from the example code from RealStudio, it also uses experience from earlier versions I once made in Delphi and ObjectiveC.

What is added here is a timer object that dynamically adjusts it's interval to ensure a timely update and reduce the likelyhood of skipping the occasional refresh (no 'jumps'). This compensates for the fact that the timer and interval as well as time taken for drawing is not accurate or constant to the millisecond.

No comments:

Post a Comment