local MainScene = class("MainScene", function()
return display.newScene("MainScene")
end) function MainScene:ctor()
cc.ui.UIPushButton.new("test/BlueButton.png", {scale9 = true})
:setButtonSize(160, 60)
:setButtonLabel(cc.ui.UILabel.new({text = "Next", size = 32}))
:onButtonClicked(function(event)
self:doPause()
end)
:align(display.CENTER, display.cx, display.cy)
:addTo(self)
end function MainScene:doPause() local renderTexture=cc.RenderTexture:create(display.width,display.height)
renderTexture:begin()
self:visit()
renderTexture:endToLua() local GamePause=require("src.app.scenes.GamePause")
local gamePause=GamePause.new(renderTexture)
cc.Director:getInstance():pushScene(gamePause)
end return MainScene

local GamePause = class("GamePause", function()
return display.newScene("GamePause")
end) function GamePause:ctor(renderTexture) local sp=cc.Sprite:createWithTexture(renderTexture:getSprite():getTexture()):addTo(self)
sp:setFlippedY(true)
sp:setColor(cc.c3b(125,125,125))
sp:setPosition(display.cx,display.cy) cc.ui.UIPushButton.new("test/BlueButton.png", {scale9 = true})
:setButtonSize(160, 60)
:setButtonLabel(cc.ui.UILabel.new({text = "back", size = 32}))
:onButtonClicked(function(event)
self:back()
end)
:align(display.CENTER, display.cx, display.cy+100)
:addTo(self) end function GamePause:back()
cc.Director:getInstance():popScene();
end return GamePause

最新文章

  1. Linux 命令积累
  2. 取得系统属性和Java环境
  3. Res_Orders_01需求分析
  4. jstack简单使用,定位死循环、线程阻塞、死锁等问题
  5. This in JavaScript
  6. Zookeeper Invalid config, exiting abnormally
  7. YTU 3004: 栈的基本运算(栈和队列)
  8. spark HA 安装配置和使用(spark1.2-cdh5.3)
  9. API接口测试01理论
  10. linux 定时下载github最新代码
  11. TsinsenA1221 大楼【矩阵快速幂】
  12. LeetCode 145 二叉树的后序遍历(非递归)
  13. ValueError: attempted relative import beyond top-level package
  14. Laravel API Tutorial: How to Build and Test a RESTful API
  15. python学习笔记:python异常的调用原理
  16. Retrofit提交Json
  17. LINQ to Entities 不识别方法“System.String get_Item(Int32)”,因此该方法无法转换为存储表达式。
  18. JAVA中解决Filter过滤掉css,js,图片文件等问题
  19. <转载>iTerm2使用技巧
  20. 寻找数组中第K大的数

热门文章

  1. [Effective JavaScript 笔记]第2章:变量作用域--个人总结
  2. Delphi开发Windows服务程序
  3. APScheduler —— Python化的Cron
  4. 暑假热身 B. 下载测速
  5. 再论pyquery
  6. centos rm -rf 恢复删除的文件
  7. linux shell 字符串操作详解 (长度,读取,替换,截取,连接,对比,删除,位置 )
  8. linux下查看文件夹的大小
  9. ubuntu安装到选择位置时闪退
  10. maven No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?