2014-09-28 2 views
1

코로나에서 스프라이트가 회전하는 것을 방지하려면 어떻게해야합니까? 내가코로나에서 스프라이트가 회전하는 것을 방지하는 방법은 무엇입니까?

이 무시됩니다
-- Create a new sprite and add it to the group 
local spriteInstance = display.newSprite(imagesheet, spriteSequences.cat) 
spriteInstance.x = 100 
spriteInstance.y = 100 
spriteInstance.isFixedRotation = true 

을 설정하지만 터치 기능을 터치 한 후

function touch(event) 

    event.target.isFixedRotation = true 
end 

처럼 수행 할 때 작동합니다. 누구가 문제인지 아는 사람 있습니까?

+0

을 명확히를 무시됩니다 "와"그것이 효과가 있습니다 ": 무엇이 당신을 그것이 무시한다고 말하게합니까? – Schollii

답변

2

physics을 본문에 먼저 추가 한 다음 isFixedRotation을 할당하십시오. 마찬가지로 : 여기

--Add a body to the rectangle 
physics.addBody(spriteInstance, "dynamic") 

-- Assign your property 
myRect.isFixedRotation = true 

당신은 touch 이벤트 기간 동안 isFixedRotation = true를 할당한다. 그래서, 당신의 터치 기능 내에서 해당 코드를 제거하고 단지로 물리 몸을 만든 후 추가 : "

spriteInstance.isFixedRotation = true 

............. 코딩 유지 :

관련 문제