How do I zoom in/out softly with a button click ?

Get help using Construct 2

Post » Mon Dec 29, 2014 5:52 am

Hi guys, I saw several tuts and suggestions but I need really something simple...could somebody post a capx ?
The first one who helps me get's a cake ;)

thanks :)
B
39
S
17
G
2
Posts: 464
Reputation: 5,049

Post » Mon Dec 29, 2014 6:16 am

While pressing a button or touching - > set scale to lerp(a,b,c)

a = start point
b = destination point
c = "Transition's velocity"

For the c, use 1*dt,2*dt,3*dt, etc
Don't forget to always use dt (delta-time)

Example:

lerp(1,3,1*dt) ==> Went from scale 1 to 3.
Remember that you can always use expressions to get the current scale for the "a" and then use it again on "b" plus any number that you want to add ou subtract in order to zoom in and zoom out.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Dec 29, 2014 7:33 am

thanks a lot...could u post a capx . that's easier 4 me to understand...thank u so much
B
39
S
17
G
2
Posts: 464
Reputation: 5,049

Post » Mon Dec 29, 2014 7:33 pm

mariogamer wrote:thanks a lot...could u post a capx . that's easier 4 me to understand...thank u so much


Zom-in-out example.capx
You do not have the required permissions to view the files attached to this post.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Dec 29, 2014 8:26 pm

1000 times thanks ! :) so kind !
B
39
S
17
G
2
Posts: 464
Reputation: 5,049

Post » Mon Dec 29, 2014 8:32 pm

just another small question... can I do that: if player in collision with another sprite > than zoom out. How can I make automaticly a zoom out just troug hitting for an instant a sprite ? Because in this moment ur sample shows a zoom where I have constantly to hold the button...I need a automatic soft zoom .... thanks again alot !
B
39
S
17
G
2
Posts: 464
Reputation: 5,049


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], jhjconstruct and 47 guests