Open pspeter3 opened 4 years ago
There's no built in function, but you can use the code from ensureVisible (https://davidfig.github.io/pixi-viewport/jsdoc/src_viewport.js.html#line1023) to calculate the values you need to plug into the animate function (https://davidfig.github.io/pixi-viewport/jsdoc/Viewport.html#animate).
I'd be willing to merge the code if you want to create a PR if you're interested.
Thanks! I'll consider adding a PR. How would you want the API to work? A new method or an option to ensureVisible?
Hmm...probably a findEnsureVisible() that returns an object with x,y,[width,height]. Or something like that. Haven't really thought about it.
OK, I'll go with something like that.
Is it possible to animate the ensureVisible function?