Wed, 31 Jul 2013 19:28:00 +0200
Flush prograss with initial commit.
michael@0 | 1 | -- Initiate scene management |
michael@0 | 2 | local sceneloc = director:createScene() |
michael@0 | 3 | sceneloc.name = 'Scene: Help' |
michael@0 | 4 | |
michael@0 | 5 | -- Constants calculated |
michael@0 | 6 | local dsw = director.displayWidth |
michael@0 | 7 | local dsh = director.displayHeight |
michael@0 | 8 | |
michael@0 | 9 | -- Fonts created |
michael@0 | 10 | local fontarial = director:createFont('fonts/Arial-96pt_bold.fnt') |
michael@0 | 11 | local fontklein = director:createFont('fonts/SegoeUI-64pt_smbld.fnt') |
michael@0 | 12 | |
michael@0 | 13 | function sceneloc:setUp(event) |
michael@0 | 14 | dbg.print('sceneloc:setUp') |
michael@0 | 15 | |
michael@0 | 16 | -- Print background |
michael@0 | 17 | local imgback = director:createSprite(0, 0, 'textures/skynorm.png') |
michael@0 | 18 | imgback.xScale = dsw / imgback.w |
michael@0 | 19 | imgback.yScale = (dsh - fontarial.height * 1.5) / imgback.h |
michael@0 | 20 | |
michael@0 | 21 | -- Heading labels |
michael@0 | 22 | local labtitle = director:createLabel({ |
michael@0 | 23 | x=0, y=-fontarial.height*1.5/6, |
michael@0 | 24 | hAlignment='centre', vAlignment='top', |
michael@0 | 25 | font=fontarial, |
michael@0 | 26 | text='Help', |
michael@0 | 27 | color={0xe0, 0xe0, 0xff} |
michael@0 | 28 | }) |
michael@0 | 29 | local butback = director:createSprite(0, 0, 'images/butback.png') |
michael@0 | 30 | butback.x = fontarial.height*1.5/2 |
michael@0 | 31 | butback.y = dsh-fontarial.height*1.5/2 |
michael@0 | 32 | butback.xAnchor = 0.5 |
michael@0 | 33 | butback.yAnchor = 0.5 |
michael@0 | 34 | |
michael@0 | 35 | -- Body text labels |
michael@0 | 36 | local rectalph = director:createRectangle(fontklein.height, fontklein.height, dsw - fontklein.height * 2, dsh - fontarial.height * 1.5 - fontklein.height * 2) |
michael@0 | 37 | rectalph.color = color.white |
michael@0 | 38 | rectalph.color.a = 64 |
michael@0 | 39 | local labcont = director:createLabel({ |
michael@0 | 40 | x=fontklein.height*1.5, y=-fontarial.height * 2 - fontklein.height * .5, |
michael@0 | 41 | w=dsw-fontklein.height*3, h=0, |
michael@0 | 42 | hAlignment='left', vAlignment='top', |
michael@0 | 43 | font=fontklein, |
michael@0 | 44 | 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' |
michael@0 | 45 | }) |
michael@0 | 46 | -- Good transitions: slideInL/R, shrinkGrow, crossFade, fadeTR/BL, pageTurn, progressVertical |
michael@0 | 47 | local transoptl = {transitionType = 'slideInL', transitionTime = 0.5} |
michael@0 | 48 | |
michael@0 | 49 | function butback:touch(event) |
michael@0 | 50 | if event.phase == 'began' then |
michael@0 | 51 | director:moveToScene(sceneMain, transoptl) |
michael@0 | 52 | end |
michael@0 | 53 | end |
michael@0 | 54 | butback:addEventListener('touch', butback) |
michael@0 | 55 | end |
michael@0 | 56 | |
michael@0 | 57 | function sceneloc:tearDown(event) |
michael@0 | 58 | dbg.print('sceneloc:tearDown') |
michael@0 | 59 | --self.obj0:removeFromParent() |
michael@0 | 60 | --self.obj1:removeFromParent() |
michael@0 | 61 | --self.obj0 = nil |
michael@0 | 62 | --self.obj1 = nil |
michael@0 | 63 | end |
michael@0 | 64 | |
michael@0 | 65 | function sceneloc:enterPreTransition(event) |
michael@0 | 66 | dbg.print('sceneloc:enterPreTransition') |
michael@0 | 67 | end |
michael@0 | 68 | |
michael@0 | 69 | function sceneloc:enterPostTransition(event) |
michael@0 | 70 | dbg.print('sceneloc:enterPostTransition') |
michael@0 | 71 | end |
michael@0 | 72 | |
michael@0 | 73 | function sceneloc:exitPreTransition(event) |
michael@0 | 74 | dbg.print('sceneloc:exitPreTransition') |
michael@0 | 75 | end |
michael@0 | 76 | |
michael@0 | 77 | function sceneloc:exitPostTransition(event) |
michael@0 | 78 | dbg.print('sceneloc:exitPostTransition') |
michael@0 | 79 | end |
michael@0 | 80 | |
michael@0 | 81 | sceneloc:addEventListener({'setUp', 'tearDown', 'enterPreTransition', |
michael@0 | 82 | 'enterPostTransition', 'exitPreTransition', 'exitPostTransition'}, sceneloc) |
michael@0 | 83 | |
michael@0 | 84 | return sceneloc |