michael@0: -- Initiate scene management michael@0: local sceneloc = director:createScene() michael@0: sceneloc.name = 'Scene: About' michael@0: michael@0: -- Constants calculated michael@0: local dsw = director.displayWidth michael@0: local dsh = director.displayHeight michael@0: michael@0: -- Fonts created michael@0: local fontarial = director:createFont('fonts/Arial-96pt_bold.fnt') michael@0: local fontklein = director:createFont('fonts/SegoeUI-64pt_smbld.fnt') michael@0: michael@0: function sceneloc:setUp(event) michael@0: dbg.print('sceneloc:setUp') michael@0: michael@0: -- Print background michael@0: local imgback = director:createSprite(0, 0, 'textures/skynorm.png') michael@0: imgback.xScale = dsw / imgback.w michael@0: imgback.yScale = (dsh - fontarial.height * 1.5) / imgback.h michael@0: michael@0: -- Heading labels michael@0: local labtitle = director:createLabel({ michael@0: x=0, y=-fontarial.height*1.5/6, michael@0: hAlignment='centre', vAlignment='top', michael@0: font=fontarial, michael@0: text='About', michael@0: color={0xe0, 0xe0, 0xff} michael@0: }) michael@0: local butback = director:createSprite(0, 0, 'images/butback.png') michael@0: butback.x = fontarial.height*1.5/2 michael@0: butback.y = dsh-fontarial.height*1.5/2 michael@0: butback.xAnchor = 0.5 michael@0: butback.yAnchor = 0.5 michael@0: michael@0: -- Body text labels michael@0: local rectalph = director:createRectangle(fontklein.height, fontklein.height, dsw - fontklein.height * 2, dsh - fontarial.height * 1.5 - fontklein.height * 2) michael@0: rectalph.color = color.white michael@0: rectalph.color.a = 64 michael@0: local labcont = director:createLabel({ michael@0: x=fontklein.height*1.5, y=-fontarial.height * 2 - fontklein.height * .5, michael@0: w=dsw-fontklein.height*3, h=0, michael@0: hAlignment='left', vAlignment='top', michael@0: font=fontklein, michael@0: text='Amalog\n\nAmateur Radio Logbook 0.7\nAmalog stores call records (QSOs) typically logged by amateur radio enthusiasts.\nVisit the Amalog Homepage\n\nCopyright 2012-2013\nMichael Schloh von Bennewitz\nMade with Marmalade SDK\n\nThis software is distributed under the terms of the European Union Public Licence (EUPL) version 1.1' michael@0: }) michael@0: michael@0: -- Good transitions: slideInL/R, shrinkGrow, crossFade, fadeTR/BL, pageTurn, progressVertical michael@0: local transoptl = {transitionType = 'slideInL', transitionTime = 0.5} michael@0: michael@0: function butback:touch(event) michael@0: if event.phase == 'began' then michael@0: director:moveToScene(sceneMain, transoptl) michael@0: end michael@0: end michael@0: butback:addEventListener('touch', butback) michael@0: end michael@0: michael@0: function sceneloc:tearDown(event) michael@0: dbg.print('sceneloc:tearDown') michael@0: --self.obj0:removeFromParent() michael@0: --self.obj1:removeFromParent() michael@0: --self.obj0 = nil michael@0: --self.obj1 = nil michael@0: end michael@0: michael@0: function sceneloc:enterPreTransition(event) michael@0: dbg.print('sceneloc:enterPreTransition') michael@0: end michael@0: michael@0: function sceneloc:enterPostTransition(event) michael@0: dbg.print('sceneloc:enterPostTransition') michael@0: end michael@0: michael@0: function sceneloc:exitPreTransition(event) michael@0: dbg.print('sceneloc:exitPreTransition') michael@0: end michael@0: michael@0: function sceneloc:exitPostTransition(event) michael@0: dbg.print('sceneloc:exitPostTransition') michael@0: end michael@0: michael@0: sceneloc:addEventListener({'setUp', 'tearDown', 'enterPreTransition', michael@0: 'enterPostTransition', 'exitPreTransition', 'exitPostTransition'}, sceneloc) michael@0: michael@0: return sceneloc