我目前正在使用本机阶段来计算我所使用的项目物理世界中的物理体,显示对象是建立在星空引擎上的。
我想知道这是否是最佳的混合方式(在进入帧中使用本机阶段),或者也许有更好的方法:
PivotJoint(_hand).anchor1.setxy( _nativeStage.mouseX,_nativeStage.mouseY );
我遇到了一些问题,拖在不同的决议和一些性能问题,我怀疑这可能是原因。
谢谢!
发布于 2014-02-18 20:50:25
我不确定它是否会提高性能,但你可以使用Starling的触摸事件来获得舞台鼠标的和弦。
试一试如下:
private var stageCoords:Point = new Point();
stage.addEventListener(TouchEvent.TOUCH, onTouch);
private function onTouch(e:TouchEvent):void {
var touches:Vector.<Touch> = e.getTouches(stage);
if(touches.length > 0){
stageCoords = touches[0].getLocation(stage);
}
}https://stackoverflow.com/questions/21861058
复制相似问题