创建按钮

cc.MenuItemFont.setFontSize(18);
            cc.MenuItemFont.setFontName("Arial");
            var systemMenu = cc.MenuItemFont.create("Main Menu", this.onSysMenu);
            var menu = cc.Menu.create(systemMenu);
            menu.setPosition(0, 0);
            systemMenu.setAnchorPoint(cc.p(0, 0));
            systemMenu.setPosition(winSize.width-95, 5);
            this.addChild(menu, 1, 2);

按钮事件

onSysMenu:function (pSender) {
this.bStop = !this.bStop;
        if (this.bStop) {
            cc.Director.getInstance().pause();
        }
        else {
            cc.Director.getInstance().resume();
        }


    }

 

posted on 2013-11-06 15:21  凌度  阅读(1627)  评论(0编辑  收藏  举报