WinView = Subview:extend { onNew = function (self) local boxW = 550 local boxH = 190 local boxL = the.app.width / 2 - boxW / 2 local boxT = the.app.height / 2 - boxH / 2 local boxR = boxL + boxW local boxB = boxT + boxH local nr = 'data/NewRocker-Regular.otf' self.scale = the.app.scale self.realTranslate = the.app.view.realTranslate self:add(Fill:new{ fill = {240,221,58}, x = boxL - 16, y = boxT - 16, width = boxW + 32, height = boxH + 32, }) self:add(Fill:new{ fill = {166,44,217}, x = boxL, y = boxT, width = boxW, height = boxH, }) self:add(Text:new{ text = 'You found the shinies!', x = boxL, y = boxT + 25, width = boxW, font = {nr, 48}, align = 'center', tint = {0,0,0} }) self:add(Text:new{ text = 'Press Q to quit', x = boxL, y = boxT + 100, width = boxW, font = {nr, 20}, align = 'center', tint = {0,0,0} }) self:add(Text:new{ text = 'Any other key to keep exploring', x = boxL, y = boxT + 130, width = boxW, font = {nr, 20}, align = 'center', tint = {0,0,0} }) end, onUpdate = function (self) if the.keys:justPressed('q') then if the.profiler then the.profiler:stop() local outfile = io.open( "profile.txt", "w+" ) the.profiler:report( outfile ) outfile:close() end the.app:quit() elseif the.keys:allJustPressed() then self:deactivate() end end }