2014-12-18 1 views

답변

0

마음에 오는 첫번째 것은 내가 질문을 이해한다면 사용하여 회전해야하는 점입니다, 당신은 모든 스프라이트를 이야기한다 : 당신의 코멘트

위해 편집 sprite.setOrigin(yourPointVector2.x, yourPointVector2.y); sprite.rotation(yourRotation);

편집 새로운

1 스프라이트 회전에 대한 간단한 테스트는 아마도 최선의 방법은 아니지만 지금 당장 저에게 발생했습니다. 나는 스프라이트의 초기 위치를 저장하는 변수를 만들 것이다, (240), 스프라이트는지도의, 50.50에있는 경우이 같이 enter image description here , 당신을 돕고,지도의 중심은 400

예 :

//is stored only once, because if not will store where you are during rotation 

yourVectorPosInicial.x = sprite.getX(); 
yourVectorPosInicial.v = sprite.getY(); 

yourVectorCenterMap.x = 400f; 
yourVectorCenterMap.y = 240f;` 

youtSprite.setOrigin(yourVectorCenterMap.x-yourVectorPosInicial.x , 
        yourVectorCenterMap.y-yourVectorPosInicial.y); 

//this in your Draw or update render 

sprite.rotation(10f); 
+0

유일한 문제는 setOrigin가 스프라이트의 좌표를 기준으로, 그리고 화면 –

+0

SK-IO @ 나는 당신의 편집 tomorow를 시도 할 것이다, 당신의 의견에 대한 –

+0

감사 정보를 추가 할 것입니다. –