0
我對Corona SDK相當陌生,可以使用一些幫助。我創建了一個連接點遊戲,並遇到重新設置焦點的問題。如何在Corona SDK中將event.phase ==「移動」設置爲focus?
每個點都有一個onTouch
事件:
function onTouch(self, event)
if event.phase == "began" then
display.getCurrentStage():setFocus(self)
table.insert(selectedDots, self)
self.isSelected = true
elseif event.phase == "moved" then
display.getCurrentStage():setFocus(self)
if self.Selected == false then
table.insert(selectedDots, self)
self.Selected = true
end
elseif event.phase == "ended" or event.phase == "cancelled" then
--remove dots
end
end
基本上,我希望玩家按下一個點不放,他們同時保持接觸任何其他的點是「選擇」。我做了所有的工作,直到我意識到除非玩家在點上結束他們的接觸,否則結束階段不會觸發。
任何幫助/建議將不勝感激。我卡住了!
太謝謝你了! – jon