2013-06-06 7 views
1

두 개의 이미지가 있습니다.두 개의 이미지가 겹쳐지면 하나의 이미지가 사라집니다. 그것을 해결하는 방법?

//1. 
player = new Sprite(300, 670, this.mChaTextureRegion, this.getVertexBufferObjectManager()); 

//2. 
body[i] = PhysicsFactory.createCircleBody(this.mPhysicsWorld, ball[i], BodyType.DynamicBody, FIXTURE_DEF); 
ball[i].setUserData(body[i]); 
mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(ball[i], body[i], true, true)); 
this.mScene.registerTouchArea(ball[i]); 
this.mScene.attachChild(ball[i]); 

볼은 TouchArea로 정의되어 있지만 플레이어는 아닙니다. 두 이미지 (플레이어와 공)가 겹쳐져 플레이어를 만진 경우 플레이어가 사라집니다. 플레이어가 사라지지 않아야합니다. 어떻게이 문제를 해결할 수 있습니까 ??

답변

0

희망이 도움이 될 수 : 사용

final ILayer layer = mEngine.getScene().getLayer(YOUR_LAYER); 
layer.addEntity(ball); 
mPhysicsWorld.registerPhysicsConnector(ball.getPhysicsConnector()); 

각 공을 등록하지만, 볼에 터치를위한 onSceneTouchEvent 다음 테스트를 사용하지 마십시오

for (Ball ball : balls) { 

if (ball.contains(eventx, eventy)) { 
//touching the ball 
} 
관련 문제