文件名称:mousejoint
介绍说明--下载内容均来自于网络,请自行研究使用
Android (鼠标关节-拖拽Body)
// 鼠标关节
public MouseJoint createMouseJoint() {
MouseJointDef mjd = new MouseJointDef()
//设置鼠标关节的第一个Body实例(默认使用接地Body)
mjd.body1 = world.getGroundBody()
//设置鼠标关节的第二个Body实例(被拖拽的Body)
mjd.body2 = body1
//设置目标点的X坐标
mjd.target.x = body1.getPosition().x
//设置目标点的Y坐标
mjd.target.y = body1.getPosition().y
// body1.allowSleeping(false) //设置body1永不休眠
// 设置鼠标关节的目标位置
mjd.maxForce = 100 // 拉力
//由World来创建鼠标关节
MouseJoint mj = (MouseJoint) world.createJoint(mjd)
return mj
}-Android (mouse joints- Drag Body)// mouse joint public MouseJoint createMouseJoint () {MouseJointDef mjd = new MouseJointDef () // set the mouse joints first Body instance (default grounding Body) mjd.body1 = world. getGroundBody () // set the mouse joint second Body instance (being dragged Body) mjd.body2 = body1 // Set the target point X coordinate mjd.target.x = body1.getPosition () x. // Set the Y coordinate of the target point mjd.target.y = body1.getPosition () y .// body1.allowSleeping (false) //set body1 Never Sleep// set the mouse joint target location mjd.maxForce = 100 //Rally// Create the World Mouse joint MouseJoint mj = (MouseJoint) world.createJoint (mjd) return mj }
// 鼠标关节
public MouseJoint createMouseJoint() {
MouseJointDef mjd = new MouseJointDef()
//设置鼠标关节的第一个Body实例(默认使用接地Body)
mjd.body1 = world.getGroundBody()
//设置鼠标关节的第二个Body实例(被拖拽的Body)
mjd.body2 = body1
//设置目标点的X坐标
mjd.target.x = body1.getPosition().x
//设置目标点的Y坐标
mjd.target.y = body1.getPosition().y
// body1.allowSleeping(false) //设置body1永不休眠
// 设置鼠标关节的目标位置
mjd.maxForce = 100 // 拉力
//由World来创建鼠标关节
MouseJoint mj = (MouseJoint) world.createJoint(mjd)
return mj
}-Android (mouse joints- Drag Body)// mouse joint public MouseJoint createMouseJoint () {MouseJointDef mjd = new MouseJointDef () // set the mouse joints first Body instance (default grounding Body) mjd.body1 = world. getGroundBody () // set the mouse joint second Body instance (being dragged Body) mjd.body2 = body1 // Set the target point X coordinate mjd.target.x = body1.getPosition () x. // Set the Y coordinate of the target point mjd.target.y = body1.getPosition () y .// body1.allowSleeping (false) //set body1 Never Sleep// set the mouse joint target location mjd.maxForce = 100 //Rally// Create the World Mouse joint MouseJoint mj = (MouseJoint) world.createJoint (mjd) return mj }
(系统自动生成,下载前可以参看下载内容)
下载文件列表
(鼠标关节-拖拽Body)\CreateMouseJoint\.classpath
...................\................\.project
...................\................\AndroidManifest.xml
...................\................\bin\classes.dex
...................\................\...\.om\mj\MainActivity.class
...................\................\...\...\..\MyRect.class
...................\................\...\...\..\MySurfaceView.class
...................\................\...\...\..\R$attr.class
...................\................\...\...\..\R$drawable.class
...................\................\...\...\..\R$id.class
...................\................\...\...\..\R$layout.class
...................\................\...\...\..\R$string.class
...................\................\...\...\..\R.class
...................\................\...\CreateMouseJoint.apk
...................\................\...\resources.ap_
...................\................\default.properties
...................\................\gen\com\mj\R.java
...................\................\lib\jbox2d.jar
...................\................\proguard.cfg
...................\................\res\drawable-hdpi\icon.png
...................\................\...\.........ldpi\icon.png
...................\................\...\.........mdpi\icon.png
...................\................\...\layout\main.xml
...................\................\...\values\strings.xml
...................\................\src\com\mj\MainActivity.java
...................\................\...\...\..\MyRect.java
...................\................\...\...\..\MySurfaceView.java
...................\................\bin\com\mj
...................\................\gen\com\mj
...................\................\src\com\mj
...................\................\bin\com
...................\................\gen\com
...................\................\res\drawable-hdpi
...................\................\...\drawable-ldpi
...................\................\...\drawable-mdpi
...................\................\...\layout
...................\................\...\values
...................\................\src\com
...................\................\assets
...................\................\bin
...................\................\gen
...................\................\lib
...................\................\res
...................\................\src
...................\CreateMouseJoint
(鼠标关节-拖拽Body)