UNPKG

zoomla

Version:

16年专业研发|中文alexa排名第一的CMS品牌-基于dotNET core、功能强大,集成站群、微信开发、小程序与ERP及OA办公系统,支持国际语言和多民族语言,世界五百强与大型门户专用高端网站内核CMS系统

50 lines (44 loc) 1.03 kB
var StartLayer = cc.Layer.extend({ bgSprite:null, scoreLabel:null, ctor:function () { ////////////////////////////// // 1. super init first this._super(); var size = cc.winSize; // add bg this.bgSprite = new cc.Sprite(res.BackGround_png); this.bgSprite.attr({ x: size.width / 2, y: size.height / 2, }); this.addChild(this.bgSprite, 0); //add start menu var startItem = new cc.MenuItemImage( res.Start_N_png, res.Start_S_png, function () { cc.log("Menu is clicked!"); cc.director.runScene(new PlayScene()); //cc.director.replaceScene( cc.TransitionPageTurn(1, new PlayScene(), false) );//浏览器不支持 }, this); startItem.attr({ x: size.width/2, y: size.height/2, anchorX: 0.5, anchorY: 0.5 }); var menu = new cc.Menu(startItem); menu.x = 0; menu.y = 0; this.addChild(menu, 1); return true; } }); var StartScene = cc.Scene.extend({ onEnter:function () { this._super(); var layer = new StartLayer(); this.addChild(layer); } });