너비가 1 씩 증가함에 따라 rect가 확장되고 화면 너비에 도달하면 멈추고 싶습니다. 그러나, 그것은 내 코드에서 화면 중간에 증가를 멈 춥니 다. 내가 잃어버린 것을 제게 말해 줄 수 있니?EnterFrame 이벤트가 코로나에서 일찍 중지됩니다.
W=display.contentWidth
H=display.contentHeight
local rect = display.newRect(0,0,0,100)
rect:setFillColor(0,255,0)
local function expand()
rect.width= rect.width+1
print(rect.width)
if rect.width==W then
Runtime: removeEventListener("enterFrame", expand)
end
end
Runtime: addEventListener("enterFrame", expand)
이제는 완전히 의미가 있습니다. enlightment 주셔서 감사합니다. =) –