Rocket-Bytes/Source/Editor.lua
2022-05-07 23:40:21 -06:00

33 lines
No EOL
705 B
Lua

import "CoreLibs/keyboard"
local gfx <const> = playdate.graphics
local prevtext = ""
function newProject()
mode = "newproj"
playdate.keyboard.show("NEW LEVEL")
end
function updateNewproj()
gfx.clear()
gfx.drawText("LEVEL NAME:", 0, 105)
gfx.drawTextInRect(playdate.keyboard.text:upper(),0,125, 210, 80)
end
function playdate.keyboard.keyboardWillHideCallback(ok)
if ok == false then
page = 0
playdate.wait(0.3)
editLoad()
end
end
function playdate.keyboard.textChangedCallback()
print(#playdate.keyboard.text)
if #playdate.keyboard.text > 24 then
playdate.keyboard.text = prevtext
end
prevtext = playdate.keyboard.text
end