Pharan написалa Bone has float fields x
and y
which are local values. It also has worldX
and worldY
.
You need to get them at the correct time though (ie, after the skeleton updates in that frame). That depends on whatever framework/engine you're using.
Ok, that is helpful, and nice and simple. You all do great work. SkeletonData.findBone("Firepoint").x, etc
We're using Cocos2DX. Any suggestions on how to get time it so we get the right X,Y from the correct frame / second?
I was look at the Events API to see if we could use it to alert the game engine to the right frame.
Thanks for the early tip
I've got events setup and a listener firing. I need to learn a bit more about C++ lambdas to be able to get access to the skeleton, but I think I've got everything I need to set this up. Just ... must teach my animator brain some more C++. My engineering brother is out of town for the weekend.
@Pharan - thanks again for helping me out. The lambda capture clause was simpler than expected.
I've got everything I need coming out in the log
0 event: Pistol Fire, 0, 0.000000, (null)
Found Bone at 51.459999, -31.209999 rotation 3.040000