(Just another) Analog clock with rotating sprites

The annexed .aia contains the "core" of an analog clock whose hands are simple rotating sprites on a canvas. It is not intended to be an app working on every phone. The layout is fixed to landscape, the overall dimensions are set to monitor and the clock area is set to 500x500. Nevertheless it works and my aim has been to show how sprites (and their rotating headings) can be used to create analog gauges.

The mechanism is based on the sensors-clock that fires every 200 ms. Whenever a new second is detected the seconds head is updated. Every 60 seconds the minutes head is rotated too, and the hours head is moved a bit forward to avoid "jumps" between hours (30 steps between hours and 0.5 step every minute).
The seconds head is red while minutes and hours heads are black, but they are the same .png whose dimensions and colours heve been modified accordingly.
"AM" or "PM" is also shown on the clock.
That's all folks !

Credits:
@Taifun for his Taifun_Tools extension that allows the app to stay awake.

Analog_Clock.aia (1.7 MB)

The following image contains the blocks implementing the app. (Hoping it can be readable).

3 Likes

Great :+1:
This is a Great creation, Please keep it up, you can do more better than this in future also. My best wishes with you. :blush: :tada:

Many thanks for your appreciation !

(the app is intentionally graphically poor and simple, to ease the understanding of the "behind the scene" :rofl:).

Cheers.

Appericiation is great, but app is too much featurised. :+1:

Pixel 4XL (Android 13), Pixel 7 Pro (A14), Companion & APK:

Remixed for a portrait phone:

Analog_Clock (1).aia (104.1 KB)

4 Likes

Good visual.
But please help to fix your app in order the layout of analog clock on the bottom could be displayed full on my phone screen.

Thanks.

The portrait version displayed perfectly on my phone screen.
Thanks.

Dear @Asri_Rusdi,
I've seen that you've already applied Tim's version that fits perfectly a vertical layout for phones.
As I told in my first post, my first aim was only to show how rotating sprites can be used to simulate an analog gauge (asked my by another user).
Please consider Tim's and Anke's modifications as an integration of my original app.
All the best !

Thanks for your clarification and update.
Understood that you want to share to user's question and others how rotating sprites can be used to simulate an analog gauge.
Appreciated to your sharing.

1 Like


These blocks can be simplized as:

Dear @Kevinkun, sure :+1:.
Cheers.