Analog watch with color

Get help using Construct 2

Post » Sun Apr 29, 2012 5:48 pm

Hi Guys

I made a simple analog watch in Construct 2.
There already rotates the minute hand.

Now i want to add color between 12 o'clock and the actual position of the minute hand. (like in my awesome drawn picture below the watch)

How can I do that?

Thanks for your help :D

ProgramGeru2012-04-29 17:50:09
B
20
S
2
G
2
Posts: 34
Reputation: 2,525

Post » Sun Apr 29, 2012 8:34 pm

You'll have to use an animation, or a clever arrangement of pie-sliced shaped sprites.
I'd go with the animation. Probably won't take too long to make.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Apr 29, 2012 11:44 pm

I think you could also use the Canvas plugin to manually draw it.

EDIT: This is definitely possible using the Canvas plugin. The following, while still needing a lot of work (I'm rather weak at math), demonstrates how it could be done.

canvas-plugin-analog-clock.capxUgotsta2012-04-30 00:27:08
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Mon Apr 30, 2012 4:36 am

Here is a version doing what sqiddster described--an arrangement of pie-shaped slices. Surprisingly few events.

UHR_animated.capxkittiewan2012-04-30 04:37:30
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Mon Apr 30, 2012 4:46 am

Pardon my dullness! I just realized how the Canvas plugin's Arc action works and used it to draw the shaded portion of the clock as needed. You'll likely want to make the clock image transparent on the inside so the tick marks show through.

I just updated the file. Here's another link to it. :)

canvas-plugin-analog-clock.capx
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Mon Apr 30, 2012 4:50 am

@kittiewan, excellent example and you're totally right, surprisingly few events. I just noticed your response as I was working on the update I just posted above. Must've been working through this right as you were.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Mon Apr 30, 2012 6:10 am

@Ugotsta - I'm glad you posted the canvas solution. I thought it was possible with canvas, but had no clue how. Quite cool!
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Mon Apr 30, 2012 11:56 am

Wow guys you're so amazing! :D

Both solutions are pretty cool, whereas the version with the pre-sliced pictures is easier to understand for me and also good for custom images.

But the canvas solution looks more dynamically and easier to do changes I think.

I'm gonna try it out and see which ones better for me

Thank you very much guys! :)
B
20
S
2
G
2
Posts: 34
Reputation: 2,525


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, makkancs and 35 guests