Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

unicitee

1
Posts
1
Topics
A member registered May 02, 2019

Recent community posts

Thank you for you suggestions. It was in the examples of DragonBones for pixi.js that I found the invalidUpdate() function. I'll try your suggestion and continue searching in the DragonBonesJS sources.

(2 edits)

Is there a way move dynamically a bone from skeletal animation?
I can get a bone with this code:

this.skel = ct.res.makeSkeleton('AnimationName');
var boneIKTarget = this.skel.armature.getBone('BoneName');
console.log(boneIKTarget);

But how to change its position? I tried these lines in On Step of a room  but no change appears.

boneIKTarget.boneData.transform.x = ct.mouse.x ;
boneIKTarget.boneData.transform.y = ct.mouse.y ;

Is there a method to transform it?

Thank you for your reply.

Edited :

I found a way to display the new position but I'm always looking for the way to have a precise value. The bone moves but not really at the mouse position.

// we have to add this line to update the new position
boneIKTarget.invalidUpdate();

We can too change the offset of the bone to modify its position.

boneIKTarget.offset.x = ct.mouse.x - mainIK.boneData.transform.x  ;
boneIKTarget.offset.y = ct.mouse.y - mainIK.boneData.transform.y - ct.height ;
boneIKTarget.invalidUpdate();

If someone could help.