diff -r 000000000000 -r bba7a2a225f6 resources/sceneabout.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/sceneabout.lua Thu Aug 22 19:50:12 2013 +0200 @@ -0,0 +1,112 @@ +-- Top of scene +--print('This is a new scene!') + +-- Initiate scene management +local sceneloc = director:createScene() +sceneloc.name = 'Scene: About' + +-- Constants calculated +local dsw = director.displayWidth +local dsh = director.displayHeight + +-- Fonts created +local fontArial = director:createFont('fonts/Arial-96pt_bold.fnt') +local fontSegoe = director:createFont('fonts/SegoeUI-64pt_bold.fnt') + +function sceneloc:setUp(event) + dbg.print('sceneloc:setUp') + + ---- Cancel playing streams + --audio:stopStream() + + -- Print background + local rectBack = director:createRectangle({ + x=0, y=0, + w=dsw, h=dsh, + strokeWidth=0, + color={10, 74, 134}, alpha=1}) + + -- Initialize heading labels + local labTitle = director:createLabel({ + x=0, y=-fontArial.height*1.5/6, + hAlignment='centre', vAlignment='top', + font=fontArial, + text='Astrokaat Information', + color={0xe0, 0xe0, 0xff} + }) + + -- Initialize heading buttons + local butBack = director:createSprite(fontSegoe.height, dsh-fontArial.height*1.5/4, 'images/butback1.png') + butBack.yAnchor = 1 + butBack.xScale = .8 + butBack.yScale = .8 + + -- Initialize body text labels + local rectAlph = director:createRectangle(fontSegoe.height, fontSegoe.height, dsw - fontSegoe.height * 2, dsh - fontArial.height * 2.25) + rectAlph.color = color.black + rectAlph.color.a = 64 + local labCont = director:createLabel({ + x=fontSegoe.height*2, y=-fontSegoe.height*3.25, + w=dsw-fontSegoe.height*3, h=0, + hAlignment='left', vAlignment='top', + font=fontSegoe, + text='Astrokaat - Space feline arcade game 0.7\nAstrokaat is a game where food is eaten and obstacles are avoided in a race against time.\n\nCopyright 2013 Michael Schloh von Bennewitz,\nThis software is made with Marmalade and distributed under the terms EUPL version 1.1' + }) + + -- Good transitions: slideInL/R, shrinkGrow, crossFade, fadeTR/BL, pageTurn, progressVertical + local transoptl = {transitionType = 'slideInL', transitionTime = 0.5} + local transoptr = {transitionType = 'slideInR', transitionTime = 0.5} + local transoptt = {transitionType = 'slideInT', transitionTime = 0.5} + local transoptb = {transitionType = 'slideInB', transitionTime = 0.5} + + -- Implement event handlers + function labCont:touch(event) + if event.phase == 'began' then + if browser:isAvailable() then + browser:launchURL('http://otpwcalc.europalab.com/') + end + end + return true + end + labCont:addEventListener('touch', labCont) + + function butBack:touch(event) + if event.phase == 'began' then + director:moveToScene(table.remove(nodeLastscene), table.remove(nodeLasttrans)) + end + return true + end + butBack:addEventListener('touch', butBack) +end + +function sceneloc:tearDown(event) + dbg.print('sceneloc:tearDown') + --self.releaseResources() + --self. = self.:removeFromParent() + --self.obj0:removeFromParent() + --self.obj1:removeFromParent() + --self.obj0 = nil + --self.obj1 = nil +end + +function sceneloc:enterPreTransition(event) + dbg.print('sceneloc:enterPreTransition') +end + +function sceneloc:enterPostTransition(event) + dbg.print('sceneloc:enterPostTransition') +end + +function sceneloc:exitPreTransition(event) + dbg.print('sceneloc:exitPreTransition') +end + +function sceneloc:exitPostTransition(event) + dbg.print('sceneloc:exitPostTransition') +end + +sceneloc:addEventListener({'setUp', 'tearDown', 'enterPreTransition', + 'enterPostTransition', 'exitPreTransition', 'exitPostTransition'}, sceneloc) + +return sceneloc +