45 lines
1.2 KiB
Lua
45 lines
1.2 KiB
Lua
--[[ Constants
|
|
* (all lua builtins that don't allow io/executing code)
|
|
color (interface)
|
|
gui (interface)
|
|
multi (interface bound to a processor) no thread module
|
|
|
|
callback true/false correct/wrong
|
|
]]
|
|
local label
|
|
|
|
local function index(window, q, callback)
|
|
label = window:newTextLabel(q.title)
|
|
label.align = ALIGN_CENTER
|
|
label:fullFrame()
|
|
label.textColor = color.white
|
|
label.color = color.new("#060ce9")
|
|
local correct = window:newTextButton("Correct",0,-200,0,100,0,1,.5)
|
|
correct.color = color.new("#52b11b")
|
|
local wrong = window:newTextButton("Wrong",0,-200,0,100,.5,1,.5)
|
|
wrong.color = color.new("#bd2626")
|
|
local skip = window:newTextButton("Skip",0,-100,0,100,.25,1,.5)
|
|
skip.color = color.new("#5d5d5d")
|
|
gui.apply({
|
|
fitFont={},
|
|
align=gui.ALIGN_CENTER,
|
|
OnReleased=function(self)
|
|
if self.text == "Skip" then
|
|
callback()
|
|
return
|
|
end
|
|
callback(self.text == "Correct")
|
|
end,
|
|
},correct,wrong,skip)
|
|
label:setFont(60)
|
|
end
|
|
|
|
local function update(dt) -- time in seconds that has passed since
|
|
label:centerFont()
|
|
end
|
|
|
|
return {
|
|
index = index,
|
|
update = update
|
|
}
|