Closed jrabek closed 1 year ago
I am reimplementing https://github.com/rive-app/rive-wasm/blob/master/js/src/utils/registerTouchInteractions.js#L18 in a Phaser friendly way.
Here is how I am using it: https://github.com/jrabek/rive-phaser-plugin
Thanks for raising this @jrabek - we'll take a look at this and figure out what's going on. Also you're right..seems strange that it is methods for x and y. Also will take a look at changing that to properties and let you know if issues arise from that.
This should be fixed in 1.0.86
. Just to be safe though, we'll still keep the x
and y
as functions on Vec2D
but change them to properties in the next major bump of this runtime!
Closing for now, but happy to re-open if the new version is still an issue for you!
In order to use the code from rive-canvas that shows how to convert touch points into the coordinate system of the artboard, it is necessary to construct a 2d vector and also get the values from it.
Currently
new rive.Vec2D
in Typescript isn't possible since the type lacks a constructor that accepts x and y.Also the return types of x and y are void. Also seems strange that they are functions and not just properties like the other math types in Rive.
https://github.com/rive-app/rive-wasm/blob/master/js/src/rive_advanced.mjs.d.ts#L660