Hi!
I have trouble finding out the position of the spine character/skeleton on canvas xy coordinates for it's positioning related to other items. The skeleton xy, getRootBone() xy and also get getBoundsRect() xy all return 0 while the skeleton is visibly in the middle of the canvas. From Input the mouse x and y are are coming through correctly but how could I find the x and y of the skeleton?
Spine-ts: find skeleton position on canvas
- Đã chỉnh sửa
The skeleton.x/y
are what define the skeleton's position relative to whatever coordinate system the Canvas transform, which you define, has setup. E.g. this example does exactly that, without modifying the canvas transform. skeleton.x/y
are simply the coordinates:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/spine-ts/spine-canvas/example/index.html