diff -r 000000000000 -r 7ff85f7ce3a7 resources/scenehelp.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resources/scenehelp.lua Wed Jul 31 19:28:00 2013 +0200 @@ -0,0 +1,84 @@ +-- Initiate scene management +local sceneloc = director:createScene() +sceneloc.name = 'Scene: Help' + +-- Constants calculated +local dsw = director.displayWidth +local dsh = director.displayHeight + +-- Fonts created +local fontarial = director:createFont('fonts/Arial-96pt_bold.fnt') +local fontklein = director:createFont('fonts/SegoeUI-64pt_smbld.fnt') + +function sceneloc:setUp(event) + dbg.print('sceneloc:setUp') + + -- Print background + local imgback = director:createSprite(0, 0, 'textures/skynorm.png') + imgback.xScale = dsw / imgback.w + imgback.yScale = (dsh - fontarial.height * 1.5) / imgback.h + + -- Heading labels + local labtitle = director:createLabel({ + x=0, y=-fontarial.height*1.5/6, + hAlignment='centre', vAlignment='top', + font=fontarial, + text='Help', + color={0xe0, 0xe0, 0xff} + }) + local butback = director:createSprite(0, 0, 'images/butback.png') + butback.x = fontarial.height*1.5/2 + butback.y = dsh-fontarial.height*1.5/2 + butback.xAnchor = 0.5 + butback.yAnchor = 0.5 + + -- Body text labels + local rectalph = director:createRectangle(fontklein.height, fontklein.height, dsw - fontklein.height * 2, dsh - fontarial.height * 1.5 - fontklein.height * 2) + rectalph.color = color.white + rectalph.color.a = 64 + local labcont = director:createLabel({ + x=fontklein.height*1.5, y=-fontarial.height * 2 - fontklein.height * .5, + w=dsw-fontklein.height*3, h=0, + hAlignment='left', vAlignment='top', + font=fontklein, + text='To start using Amalog now\n 1. Press \'Add\' to add a QSO call entry:\n 2. Enter free text into the add field\n 3. Press \'Okay\' to store the new entry\n 4. Repeat steps 1-3 as appropriate\n\nTo delete a QSO call entry\n 1. Press a entry in the list to highlight\n 2. Press \'Delete\' at the bottom to delete' + }) + -- Good transitions: slideInL/R, shrinkGrow, crossFade, fadeTR/BL, pageTurn, progressVertical + local transoptl = {transitionType = 'slideInL', transitionTime = 0.5} + + function butback:touch(event) + if event.phase == 'began' then + director:moveToScene(sceneMain, transoptl) + end + end + butback:addEventListener('touch', butback) +end + +function sceneloc:tearDown(event) + dbg.print('sceneloc:tearDown') + --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