Smooth camera movement

Started by Glenjamin, Sun 13/09/2015 21:53:08

Previous topic - Next topic

Glenjamin

How can I move the camera smoothly from one point to another? I'm aware of the SetViewport() function, but that just jumps the camera from one place to another.
I need a nice smooth pan for a dramatic moment. Thanks!

Jack

You can use SetViewport() with repeatedly_execute or repeatedly_execute_always to move the viewport 1, 2 or 3 pixels each frame. Just remember to call ReleaseViewport() when you're done.

Snarky

Or even simpler, with the Tween module, you can tween the viewport position, which will give a smooth camera move effect.

Ali

The Tween module will give great results, but if you want smoother camera movement in general then you could also try my Smooth Scrolling and Parallax Module: http://www.adventuregamestudio.co.uk/forums/index.php?topic=33142.msg636501798#msg636501798

You can create pans and more complex camera moves by directing the camera to an invisible character (targetCharacter = cDummy;).

Monsieur OUXX

+1 for "Smooth Scrolling & Parallax" module
 

Snarky

If you're not using parallax, is there any benefit to using that module over Tween?

Monsieur OUXX

Quote from: Snarky on Tue 15/09/2015 16:27:07
If you're not using parallax, is there any benefit to using that module over Tween?
I haven't tried tween 2.0 and its new magic (including tweening the viewport). So the answer is: Tween is probably doing it right, but you'd need to script a little, and watch out for the potential corner cases, whereas Smooth scrolling works out of the box and is flawless.
 

SMF spam blocked by CleanTalk