clock control effect

Discussion and feedback on Construct 2

Post » Mon Sep 23, 2013 10:12 pm

I'm trying to have a clock hand moving effect but should happpen when the object is dragged, something like a knob or guage control.
the capx file here depicts what i want, but not by contolling with keyboard, i'll prefer just having to drag the object and then it just moves with the other end being pivoted kind off. I dont know if its possible to achieve this with construct and how?

capx file here knob
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Sep 24, 2013 7:51 am

Here's a fairly simple way to do it, although there are many other ways. Note, I'm using the touch object here, but you could replace it with the mouse object if necessary.

Example capx.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Tue Sep 24, 2013 5:17 pm

@GeometriX, thanks a lot works perfectly but would appreciate a little explanation on the techniques or concept useed. ThanksDasat2013-09-24 17:18:23
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Sep 24, 2013 5:33 pm

Sorry, I usually comment my examples but I was in a bit of a rush.

So, there are a few ways to do this. The most simple way is with a single event, something like Touch -> Is touching object | Dial -> Rotate 5 degrees toward (Touch.X, Touch.Y).

But that limits the player to having to keep their mouse/finger on the dial the whole time. I prefer to allow them to initiate the touch while on the dial, but then they can move their mouse/finger anywhere on-screen and the dial will follow the mouse/touch.

To achieve this, I used a dummy object that is created when the user touches the dial, and is destroyed when they release the touch. But the dummy object will always follow the player's finger, no matter where it goes on-screen, and the dial will always point towards the dummy object, not the finger, which means the player can move their finger wherever they want and the dial will adjust accordingly.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Tue Sep 24, 2013 5:48 pm

@GeometriX, i think i get that, thanks a lot
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Sep 24, 2013 6:34 pm

Fantastic!
Great tip.fishbottle2013-09-24 18:36:11
B
24
S
4
G
3
Posts: 43
Reputation: 2,795

Post » Tue Jan 07, 2014 9:14 am

Very creative idea. I conceive that a clock control can be of your help.Arthurabc2014-01-07 09:16:54
B
1
Posts: 9
Reputation: 145

Post » Tue Jan 07, 2014 10:06 am

Sounds like you could also put drag and drop on that invisible object, and when dropped, snap it back to the clock.
B
239
S
62
G
33
Posts: 903
Reputation: 40,562


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest