支持VS2015的babelua 配置 vs 2015出来了吗

Cocos2dx Lua开发环境搭建 - 推酷
Cocos2dx Lua开发环境搭建
本文记录在 Windows 下搭建 cocos2dx lua 开发环境,还有调试设置。
系统:Windows 10 64
IDE:Mircrosoft Visual Studio 2015 update 3
Cocos2dx:cocos2d-x-3.13.1
VS插件:BabeLua3.2.2.0
下载 cocos2dx 源码,并运行 setup.py 脚本,该脚本为 python 脚本,所以系统还要先安装 python,最好是 2.7 版本的。
创建 cocos2dx lua 项目
到你需要创建项目的目录下运行以下命令
cocosnew testlua -p com.testlua -l lua
下载安装 VS 插件 BabeLua
主站下载(国外站点,可下载最新源码)
国内镜像(速度较快)
这里使用的是&BabeLua3.2.2.0 版本,下载完成后双击运行 vs 进行安装。
生成&simulator
打开项目目录下&frameworks\runtime-src\proj.win32\dblua.sln 文件。
点击运行按钮,或者按 F5 键开始编译并运行项目。
等待编译完成之后,项目下&\simulator\win32\ 目录中就会生成 textlua.exe ,这个就是运行 lua 脚本的主程序,也就是 simulator。
配置 Lua 项目
创建 visual studio&lua 项目
前面安装完 BabeLua 插件后,在 vs 的主菜单上会出现 Lua 菜单,点击菜单中的 New Lua Project,填写内容如下:
Lua script folder:lua 脚本目录
Lua exe path:lua 主程序目录,也就是之前的 simulator
Working path:lua 运行环境目录
Lua project name:在 VS 解决方案中显示的项目名称
Command line:执行命令,这个可以先不管
点击 OK 就会在解决方案中出现 src 项目,同时加载了 lua 文件夹中所有&lua 脚本。
接着将 src 项目设置为启动项目,在资源管理器右键 src项目 & 设置为启动项,这时按 F5 键应该就可以正常启动程序了。
如果启动后程序运行有异常,比如黑屏不显示图片什么的,不着急,继续往下看。
这里需要注意的是 BabeLua 3.2.2.0 版本会有个路径 BUG ,在调试时使用的 Lua scripts folder 目录会使用配置好的上一级目录,在执行调试时,在终端输出中会显示一堆的 file not exist 信息,所以还要对配置进行调整。
回到项目根目录下,用文本编辑器打开 src.luaprol 文件,修改其中的:
&ProjectHome&.&ProjectHome& 为&&ProjectHome&./src&ProjectHome&,然后将所有的 “ src\ ” 替换为空字符串。接着删除第一个为空的目录,大致修改后内容如下:
注意红框部分就是要修改的内容。修改完保存,回到 VS 程序,会出现重现加载对话框,点击全部重新加载。
然后按 F5 键运行程序,这时终端输出里应该就不会出现 file not exist 提示了。
然后打个断点试试看吧。
不过这里还会有个坑,会发现 main.lua 打的断点可能会无效,其他脚本则有效果,所以还需要进一步修改。
查看中终端输出会发现加载的 main.lua 为 testlua\simulator\win32\src\main.lua。如果不想每次调试都要执行 生成解决方案(Ctrl + Shift + B)的话,还要修改一下&AppDelegate.cpp。
打开项目目录下&frameworks\runtime-src\Classes\AppDelegate.cpp
if (engine-&executeScriptFile(&E:/Documents/zone/dblua/src/main.lua&))&
#if(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
if (engine-&executeScriptFile(&E:/Documents/zone/dblua/src/main.lua&)) // 此处方便调试,不用每次都生成解决方案
if (engine-&executeScriptFile(&src/main.lua&))
修改完保存并执行编译(Ctrl + Shift + B),然后按 F5 运行,这时再调试应该就一切正常了,每次修改完 lua 脚本,也不用执行编译,直接 F5 即可看到最新改动的运行情况。
以上就是 cocos2dx lua 环境搭建和调试配置的全部内容,有什么问题,欢迎留言。
感谢阅读!
如果发现启动调试比较慢,可以尝试安装秒起补丁
BabeLua官方博客
BabeLua项目地址
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致CodePlex is shutting down.
Read about the shutdown plan, including archive and migration information, on
Are you Sure?
a free lua editor/debuger (vs15 extension)
Advance features:
code highlight
lightweigh
deeply integrate into visual studio. run debugger/set breakpoint/watch variable/call stack and so on, just like use native debugger.
Requirements:
Visual Studio 2012 Standard Edition or higher.
preview images:
Revisions:
V3.2.2.0 -
New feature:
Lua exe path & Working path s
Stability improvement:
Optimize the speed of synchronize files &
V3.2.1.0 -
New feature:
Goto symbol shortcut key: &Ctrl+P& or &Alt+O&;
Stability improvement:
fix a bug: synchronize files &
V3.2.0.0 -
New feature:
support VS2015;
add synchronize files &
watch variable support Hexadecimal D
recover shortcut key &Ctrl+P&;
V3.0.1.0 -
New feature:
support create &Lua Project& to manage lua files, replace &Folder Explorer&;
improve auto completion, support multiple auto completion list, optimize auto completion for cocos2d;
V2.1.4.0 -
New feature:
Stability improvement:
fix a bug that analyze
fix a bug can't hit breakpoint when
V2.1.3.0 -
New feature:
can set: Output more debugging information in &output window&;
Stability improvement:
Optimize the spe
V2.1.2.0 -
New feature:
Stability improvement:
recover shortcut key &Ctrl+P&;
Improve &self&
V2.1.1.0 -
New feature:
delete 'All word'
Performance improvement:
V2.0.6.0 -
New feature:
Stability improvement:
use double click to goto the location of item in &Outline Explorer&
delete files/directory moved to the recycle bin in &Folder Explorer&;
V2.0.5.0 -
New feature:
Stability improvement:
support VS2013 (the version is higher than update 2)
V2.0.4.0 -
New feature:
Recover Shotcut keys : Ctrl+2,Ctrl+3,Ctrl+4;
Stability improvement:
Optimize the speed of analysis L
V2.0.3.0 -
New feature:
Delete Shortcut keys : Ctrl+2,Ctrl+3,Ctrl+4;
Highlight Lua5.1
V2.0.2.0 -
New feature:
Provide loading and unloading &Current setting&;
Folder Explorer provides
Stability improvement:
Improve the speed of loading and parsing L
V2.0.1.0 -
New feature:
Auto completion support multi-
Auto completion support Intelligent matching and A
Add navigation to window ( ctrl+3 or Ctrl+P ),including search files, quickly search f
Stability improvement:
V1.6.8.0 -
New feature:
watch string variable values during debugging, support multiple languages: English, Simplified Chinese, Traditional C
Stability improvement:
optimize th
V1.6.7.0 -
New feature:
add a file search window ( ctrl+1 or Alt+L ), like The file search in VC A
Stability improvement:
performance improvement when BabeLua load/
performance improvement when deb
V1.6.5.1 -
New feature:
Stability improvement:
fix a bug that pop up error &System.Net.WebResponse EndGetResponse&;
V1.6.4.0 -
New feature:
&print& content display to the &output&
Stability improvement:
fix a bug that the breakpoint will not currently be hit, because the lua file path is special ( just like c:\proj\.\script\config.lua );
V1.6.3.0 -
Important changes:
use &package.path& as lua search
V1.6.2.0 -
Important changes:
&outline explorer& display functions & variables list
Other changes:
adjust the settings interface layout,adapt to lo
output informatio
Stability improvement:
fix a bug that functions & variables list is not correct w
V1.6.1.0 -
New feature:
display lua file nam
Stability improvement:
changed 'tostirng' to 'tostring' in lua5.1.
fix a bug that may cause an exception when
fix a bug that may cause VS crash on cocos2d-x3.0;
V1.6.0.0 -
New feature:
add a simple code au
add more search features in &search result 1/2&;
Stability improvement:
V1.5.7.0 -
Stability improvement:
use &lua scripts folder& as lua search
V1.5.6.0 -
New feature:
support debug quick-cocos2d-
support text search in scripts folder now, you can use this function in Search Result W
New feature:
support lua5.1 keyw
debug message would write
editor outline combobox’s members now will sorting
Stability improvement:
fix a bug that when search in a file which not exists in current setting folder , result of switch relative path functi
Performance improvement:
decrease the sensitive of syntax analysis when document content changes,
New feature:
Auto Completion database extend is supported now. Look up our docume
watch local variables when switch between debug sta
relative or absolute path view is supported at Search Result Window, you ca
Stability improvement:
fix a bug that when file contains mac’s line end(‘\r’) ,its line number w
fix a bug that comment would not
Stability improvement:
support relative path when
improve variable view
fix a bug that when a file is loaded at runtime , its breakpoints w
New feature:
improve tool windows color scheme to look better with
comment/uncomme
Stability improvement:
fix a bug that may cause vs unresponsive when
fix a bug that can not watch table members like table[‘number’] stru
fix a bug that the item may disappear at Folder Explorer when m
fix a bug that may cause an exception when use ‘find reference’ function within a file which c
New feature:
watch variable directly with cursor move ov
show line n
Stability improvement:
fix a bug that may cause vs crash when user choose an invalid folder
fix a bug that may cause a problem when switch files quickly at Folder Explorer W
fix a bug that may cause vs unresponsive when debugging and ste
change the editor default lua table and function view colors form (0,0,0) to (200,100,0).you can change them at ‘Setting.xml’
New feature:
integrate debug tools into babelua , now you can debug lua code in vs just like c++ or c#;
Stability improvement:
fix a bug that may cause an exception when
Performance improvement:
optimize auto c
add a setting item so that you can change lua executab
update some tool windows so that they can show better at vs 2013;
Stability improvement:
fix a bug when typein some words in editor the cursor may not been controled up/
fix a bug that may throw an exception when a file is opened
fix a bug when typein chinese character behind comment ma
Stability improvement:
fix a bug that may cause vs crash when click an item a
fix a bug that may cause vs crash when trigger quick sea
fix a calculate err
New feature:
support user define object definition and
New feature:
support user define table
add user keywords groups to at most 15;
Performance improvement:
Stability improvement:
fix a bug that may cause vs crash when mark a l
fix a bug when delete a file outside vs ,folder window
Getting Started :
1,Open Settings Window from menu - LUA - S
2,Change Tab to [Lua Folder];
3,Choose your working path and other info from [New folder setting],then click [save];
4,Choose the setting you added at step 3, click S
5,Now you can see the files from [Folder Explorer] window.
6,A temp_ project would be created for debug when first lua file be opened, you should set this project as StartUp Project.
Compatibility:
Lua5.1 Cocos2d- Babe2D(Boyaa);
Lua5.2, LuaJIT, Love2d, Moai, Gideros, Marmalade Quick, Corona, GSL-
Not implement:
remote debugging, such as connect to a mobile device
Blog:(chinese)
Author : RugbbyLi , LilongLg, CarefreeLi
BabeStudio
Special thanks :
Last edited
by , version 64如何用BabeLua运行Lua代码
如何用BabeLua运行Lua代码
一:BabeLua简单介绍
& & & BabeLua是一款基于微软VisualStudio系列产品的免费开源的Lua集成开发环境,可以用来Lua语言的编译与调试。
二:如何用BabeLua成功运行Lua代码
1.首先你得安装好VisualStudio,我使用的是VS2015+Windows10系统环境,当然你也可以使用VS2012或者2013。
2.接下来下载BabeLua,你有两个方式,一个是在VS的扩展与更新里找到BabeLua(见上图),点击下载安装,也可以访问它的网站 &,出现下图
点击下载,出现下图,
根据你的VS版本下载相应的版本就好了,下载好后,安装,重启VS,如果安装成功你就会在VS的菜单栏发现Lua
3.不要急,还有两个没有下载,如果要执行代码还需要Lua For Windows,你可以去Lua官网下载,链接为 &,下载后先不要安装。
安装Lua For Windows可能需要先安装VC2005运行库,下载地址为 &
4.安装好VC2005后,开始安装Lua For Windows,安装目录最好选在自己知道的目录,因为后面的工程会用到。(默认位置在C:\Program Files (x86)\Lua)
三:建立Lua工程
点击菜单栏上的Lua,新建一个工程,出现下图
Lua&scripts&folder:lua代码的路径
Lua&exe&path:调试时启动的exe文件路径,你需要设置为Lua
For Windows安装目录下lua.exe文件的路径,你可能在安装目录下发现lua这个exe程序,如下图
将当前路径放进去再自己手动添加 & \lua.exe & 这七个字符进去。
Working&path:工作目录,与“Lua&scripts&folder”一致。
Commond&line:运行的Lua文件名,下图示例中运行的Lua文件名是MyHelloWorld.lua。
补充:os.execute(&pause&);这段代码的作用是,运行程序时,可能会出现一闪而过的情况,在程序末尾加上这段代码就可以解决。
我的热门文章
即使是一小步也想与你分享vs2015大概要什么配置能流_c吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:89,304贴子:
vs2015大概要什么配置能流收藏
vs2015大概要什么配置能流畅?
上海工商外国语职业学院针对三校生低分注册200名,
8G内存,VS安装到SSD里面,CPU4核
vs2015?我的电脑根本带不动
不建议你用,才出的东西 不成熟,各种问题都找不到解决办法,我折腾了半天,连C++的模板都没找到在哪!
开始安装时微软官网下载的3M的安装包,安装时选的是全选,安装完成后装中文语言包,装完没有C++,卸载了重新装3G多的安装包,中文的,安装时还是选择的全选,装完还是没C++,更改修复了几次,最厚果断卸载了!
Windows 7 ,
东芝固态硬盘, 4G内存, 酷睿 i 3 -2350M 处理器, 就这些吧
内存要大,处理器要好,屏幕要大,键盘要好。
吃饱了撑的,vs系列更新,主要是更新net那一块,也就是C#,C++部分只增加了很少一部分,MFC基本没动,就增加了少数C11++标准,关键,实际中用得还不多,没必要的,要知道现在还有许多人仍然在用VC6.0,也活得挺好。一般来说,xp,2010足够了,64位系统,用vs2012就行了。如果是在C#吧,尝试2015,勇气可嘉,当时在C++吧,不合适,基本没变啊,所以,没必要升级的,要知道我现在依然在使用XP系统,前一段时间换成了Win7的,用不了VC6.0,又换回来了。我系统现在是用VC6.0+VS2010,足够了。
VC6.0最大的缺点,就是模版支持不好,否则我也不会尝试使用VS2010,没办法,stl库还是非常重要的。
三生三世 与你相遇!
2015推荐安装了一下午,结果操作了一下,挂了。。。
VS2015相当于编辑器 txt
.net4.6相当于函数库对吗,新手
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或

我要回帖

更多关于 babelua for 2015调试 的文章

 

随机推荐