----------------------------- -- Levak ©2011 -------------- -- http://levak.free.fr/ ---- -- levak92@gmail.com -------- ----------------------------- ------ Help management Help = class(Screen) function Help:paint(gc) local sX, sY = platform.window:width(), platform.window:height() -- window local W, H = xlarge*16, xlarge*10 gc:setColorRGB(255, 255, 255) gc:setPen("thin", "smooth") gc:fillRect((sX - W) / 2, (sY - H) / 2, W, H) gc:setColorRGB(0, 0, 0) gc:setPen("thin", "dashed") gc:drawRect((sX - W) / 2, (sY - H) / 2, W, H) -- text local title = "Sudoku" local author = "Levak ©2011" local website = "http://levak.free.fr, http://www.inspired-lua.org" local margin = normal local x, y = (sX - W) / 2 + margin, (sY - H) / 2 + margin gc:setColorRGB(0, 0, 0) gc:setFont("sansserif", "b", fxxlarge) gc:drawString(title, x, y, "top") gc:setFont("sansserif", "r", fxxsmall) gc:drawString(author, x + #title*xxlarge, y + xxlarge, "middle") y = y + normal + xxlarge gc:setFont("sansserif", "r", fxsmall) gc:drawString(website, x, y, "top") y = y + normal + small gc:drawString("Shortcuts :", x, y, "top") y = y + normal gc:drawString("s Display/Hide the grid solution", x, y, "top") y = y + normal gc:drawString("c Display/Hide the grid checker", x, y, "top") y = y + normal gc:drawString("p Pause/Unpause the game", x, y, "top") y = y + normal gc:drawString("1 - 9 Place a number", x, y, "top") y = y + normal gc:drawString("0 Erase a number", x, y, "top") paused = true end function Help:escapeKey() PullScreen() paused = false platform.window:invalidate() end -- non used events function Help:charIn(ch) end function Help:arrowKey(key) end function Help:enterKey() end function Help:help() end function Help:mouseUp() end function Help:contextMenu() end