Camera ease-in-out

Get help using Construct 2

Post » Wed Mar 13, 2013 12:04 pm

Hi all,

I'm trying to create a camera that eases in, then eases out using the scroll actions.

Does anyone have an idea how this could be implemented relatively simply?

Thanks!
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Wed Mar 13, 2013 12:14 pm

I've been using Yann's technique in this thread for similar stuff: http://www.scirra.com/forum/smooth-zooming-and-more_topic49004_post308296.html
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Mar 13, 2013 12:16 pm

Thanks @vee41. Perhaps I should have been more clear, I meant easing in and out along the x and y axis, not zooming in/out.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Wed Mar 13, 2013 12:44 pm

[QUOTE=thehen] Thanks @vee41. Perhaps I should have been more clear, I meant easing in and out along the x and y axis, not zooming in/out.[/QUOTE]

Another Yann example I've been using for something similar: http://www.scirra.com/forum/clickdrag-to-pan-camera_topic45640.html

:)

Something like lerp(screenPositionX, screenTargetX, dt) should work too. Or did I misunderstand, you wish to smoothly scroll the screen from X,Y to another X,Y?
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Mar 13, 2013 12:56 pm

Yeah I'm using lerp at the moment, but I want to ease in, and then ease out. Lerp just eases out. Thanks for the input though!thehen2013-03-13 13:11:05
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Wed Mar 13, 2013 1:26 pm

If custom plugins are an option, EaseTween has easeIn/Out function. If not, perhaps some unholy custom combination of lerp/unlerp would work?
B
24
S
8
G
7
Posts: 756
Reputation: 7,192


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests