davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.04k stars 174 forks source link

How to moveCenter with easing? #464

Closed rienheuver closed 11 months ago

rienheuver commented 11 months ago

I'm using pixi-viewport and pixi-ease in my application and want to ease the camera movement when calling viewport.toCenter(). But how do I do this?

blnvdanil commented 11 months ago

There is Animate plugin, isn't it what you are looking for?

rienheuver commented 11 months ago

I've just been trying this, but can't get any difference to work. I also can't find much documentation on what .animate is or does. Could you perhaps help me along with this?

blnvdanil commented 11 months ago

I guess that you should just call animate instead of moveCenter() There is a simple example which moves viewport on click https://codesandbox.io/s/laughing-sound-dqtk7f

rienheuver commented 11 months ago

Ah right, that works. Thanks! This should really be documented somewhere better in my opinion, but at least it works now