我在名字上有一个动态体,想让它的x位置跟随鼠标,这是可能的吗?
player = new Body(BodyType.DYNAMIC);
player.shapes.add(new Polygon(Polygon.rect(400, 350, 100, 150)));
player.shapes.add(new Polygon(Polygon.rect(435, 450, 20, 150)));
player.shapes.add(new Polygon(Polygon.rect(380, 600, 150, 20)));
player_mc = new MovieClip(Assets.tb.getTextures("player"));
player.userData.graphic = player_mc;
player.space = space;
addChild(player.userData.graphic);发布于 2013-05-01 02:19:26
建议的方法是使用约束。
在FixedDragging示例中查看如何做到这一点:http://napephys.com/samples.html#swf-FixedDragging (查看源代码,顶部有.as/.hx选项卡)
https://stackoverflow.com/questions/16297249
复制相似问题