Hi,
I am trying to adapt the Box2d camera demo to make the ball follow the mouse when the button is down, but the ball movement is not very good (work ok when the screen is not moving, once the screen scrolls it awful). I am using a mousejoint.
Could an expert assist with a modified version that allows me to use the mouse\touch to drag the ball across the screen and remain smooth? Please?
Comments
can not answer right now, will experiment more.
But yes mouse movement will interfere with object centering, so you can't make object centered, but need some other approach to keep it on screen
It's important for me to obtain the right movement.
Would you give us a ray of light on the approach you are thinking or the solution itself?
Thanks.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
I don't know if I understood well your problem.
I believe, you can try with @Niicodemus 's Camera (http://giderosmobile.com/forum/discussion/comment/30138#Comment_30138) and @ar2rsawseen 's Box2dEasy (again sawseen) as follows:
[-] Liasoft
I've tried to adapt the code in order to achieve the correct ball movement with the camera but it's not working.
Hey @ar2rsawseen I noticed you added a change to Box2dEasy (https://github.com/ar2rsawseen/GiderosCodingEasy) after @HubertRonald post his code here.
Have you tried it?
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
Well the main problem is, that when camera is moving, it moves so the object is centered.
But then, in the same time, you want to take and drag that object.
When dragging it you expect it to move relative to the current screen, but the screen is again, following the object, due to the camera move.
For now I can see only one solution, start camera movement only when you reach the end of the screen while dragging an object.
But if this solution will be helpful or not, I would like to understand more of a purpose of what you are trying to achieve (and I currently can't imagine efficient solution)
Likes: Yan
Yesterday I can't upload sample because internet was failing (
P.S.
1.- This file not include last version of Box2dEasy
2.- How said @ar2rsawseen: I currently can't imagine efficient solution too
3.- I don't know why I can't upload zip file :P
[-] Liasoft