Mouse/Grab with PivotJoint for cocos2d-js

Official forum for the Chipmunk2D Physics Library.
Post Reply
jhneves
Posts: 9
Joined: Thu Jul 25, 2013 12:42 pm
Contact:

Mouse/Grab with PivotJoint for cocos2d-js

Post by jhneves »

Hi, I am trying to replicate the mouse example from c to chipmunk-js. I did replicate it fine when using cocos2d-html5 but when running on iphone with cocos2d-js it didnt work because the pivotjoint only takes 1 anchor point when creating it...

https://github.com/slembcke/Chipmunk2D/ ... emo.c#L398

How can I make this work with only 1 anchor point?
Last edited by jhneves on Thu Jul 25, 2013 7:33 pm, edited 1 time in total.
jhneves
Posts: 9
Joined: Thu Jul 25, 2013 12:42 pm
Contact:

Re: Mouse/Grab with PivotJoint

Post by jhneves »

I solved it.
What I did was set the mouseBody position to the location of click/touch before creating the PivotJoint.
And as anchor for the joint I use the position of the click/touch.
:)
sortris
Posts: 4
Joined: Mon Oct 21, 2013 8:34 am
Contact:

Re: Mouse/Grab with PivotJoint for cocos2d-js

Post by sortris »

Hi, Could you post here your code snippet for that?
andrikaa
Posts: 1
Joined: Thu Feb 13, 2014 1:21 am
Contact:

Re: Mouse/Grab with PivotJoint for cocos2d-js

Post by andrikaa »

What exactly is javascript? and is there a way I can enable it on my computer because when I'm on different websites I keep getting pop-ups saying that I need javascript to continue.
_______________________
movies clip ~ music video ~ video collection
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests