0
커스텀 애니메이션으로 롤링 주사위를 만들었습니다. Check out this video to see it애니메이션 코로나 로딩 중에 이전 이미지 삭제
이제 주사위 애니메이션이 시작되는 동안 이전 이미지가 배경에 머무르고 애니메이션이 끝난 후에 바뀝니다. 애니메이션이 시작될 때 배경에서 이미지를 제거하고 싶습니다. 아무도 내가 어떻게 할 수 있다고 말할 수 있습니까?
여기 내 주요 이벤트 코드
local function listener(event)
if event.phase == "began" then
audio.play(diceSound)
dice = display.newImage("images/dice3droll.png")
physics.addBody(dice, {bounce = 2.8})
physics.addBody(grass, "static", {bounce = 0.6})
dice.x = display.contentWidth/2
dice.y = display.contentHeight/2
dice.isFocus = true
dice:scale(2,2)
display.getCurrentStage():setFocus(dice)
Runtime:addEventListener("enterFrame", rotateDice)
local function timerE(ev)
rand=math.random(6)
dice:removeSelf()
dice.isFocus = false
dice = display.newImage("images/dice"..rand..".png")
dice.x = display.contentWidth/2
dice.y = display.contentHeight/2
Runtime:removeEventListener("enterFrame", rotateDice)
end
timer.performWithDelay(2000, timerE, 1)
end
return true
end