Rocket-Bytes/Source/Editor.lua

33 lines
705 B
Lua
Raw Normal View History

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