vs2015 + BabeLua + Cocos2d-x
http://blog./u012132482/article/details/50706244?locationNum=8&fps=1
vs打开编译后的cocos项目
再次打开工程,用vs2015打开 luaproj文件即可
:
在
加上:engine->executeString("print = release_print");
(Button)
--
local root = :createNode("")
root:addTo(self)
--获取名称为PlayButton的按钮,然后添加这个按钮在接受到点击时的处理代码
root:getChildByName("Button_1")
:addClickEventListener(onPlay)
local function onPlay()
print("==== MainScene:onPlay()")
--进入PlayScene,使用闭包catch self变量。
self:getApp():enterScene("Sceond")
end
(目录结构):
选择vs2015打开项目(结构)
选择右键“生成”,项目生成“simulator”文件夹
lua
生成后的项目结构:
(右键)
local GameScene = class("GameScene", ("mvc").ViewBase)
function GameScene:onCreate()
print("====GameScene:onCreate()")
vs2015和cocos使用攻略 来自淘豆网www.taodocs.com转载请标明出处.