1
텍스트 상자 테이블이 있습니다. 여기서 키는 위치의 이름입니다 (topRight, topLeft ...). 생성 및 한 번에 하나의 구성에사전/텍스트 상자를 반복하는 방법은 무엇입니까?
잘 작동합니다 :
kanaAt = {}
function startKanas()
kanaAt.topLeft = MOAITextBox.new()
kanaAt.topLeft:setFont(font)
...
kanaAt.topLeft:setString("か")
layer:insertProp (kanaAt.topLeft)
kanaAt.topRight = MOAITextBox.new()
kanaAt.topRight:setFont(font)
...
kanaAt.topRight:setString("た")
layer:insertProp (kanaAt.topRight)
end
하지만 그것을 통해 반복하려고하지 않을 때 : 내가 잘못
kanaAt = {}
function startKanas()
kanaAt.topLeft = MOAITextBox.new()
kanaAt.topRight = MOAITextBox.new()
kanaAt.bottomLeft = MOAITextBox.new()
kanaAt.bottomRight = MOAITextBox.new()
for name, text in ipairs(kanaAt) do
text:setFont(font)
text:setTextSize(90,60)
text:setYFlip(true)
text:setRect(-50,-50,50,50)
layer:insertProp (text)
end
kanaAt.topLeft:setString("か")
kanaAt.topLeft:setLoc(-325, 225)
kanaAt.topRight:setString("た")
kanaAt.topRight:setLoc(325, 225)
kanaAt.bottomLeft:setString("ち")
kanaAt.bottomLeft:setLoc(-325, -225)
kanaAt.bottomRight:setString("つ")
kanaAt.bottomRight:setLoc(325, -225)
end
을하고있어 무엇?
감사합니다. 내 부분에서 어리석은 실수! –