0
마우스 오른쪽 버튼을 누르면 "모드"테이블에 두 번째 문자열을 인쇄하려고했습니다. 그러나 버튼을 클릭하면 "모드 : 원"대신 "모드 : 1"이 인쇄됩니다. 여기 내 코드는 다음과 같습니다.인쇄 된 문자열을 Lua, Love2D의 테이블로 대체하는 방법
function love.load()
mode = {"square", "circle"}
currentMode = mode[1]
end
function nextMode()
currentMode = next(mode)
print(currentMode)
end
function love.draw()
love.graphics.print("mode: " .. currentMode, 10, 10)
end
function love.mousepressed(x, y, button)
if button == "r" then
nextMode()
end
end
누군가 내가 잘못하고있는 것을 말해 줄 수 있습니까?