摘要: --display.replaceScene源码function display.replaceScene(newScene,transitionType,time,more) if sharedDirector:getRunningScene() then if transitionType then newScene = display.wrapSceneWithT... 阅读全文
posted @ 2017-01-04 14:42 feizuzu 阅读(730) 评论(0) 推荐(0) 编辑
摘要: --创建带物理世界的scenelocal physicScene = display.newPhysicsScene("physicsecene")--用来获取场景绑定的物理世界对象physicScene:getPhysicsWorld() --改变重力值physicScene:getPhysicsWorld():setGravity(cc.p(0,-9.8*10))-- 开启调试模式scene:... 阅读全文
posted @ 2017-01-04 14:41 feizuzu 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 进度条控件cc.ui.UILoadingBar.new(table)--[[参数 table{ scale9 boolean类型 表示是否缩放 canInsets, cc.rect类型 社会图片的缩放区域 避免银缩放导致图片失真 image string类型 表示进图条图片 viewRect cc.rect类型 表示显示区域 percent int 类型 表示初始值进... 阅读全文
posted @ 2017-01-04 14:41 feizuzu 阅读(239) 评论(0) 推荐(0) 编辑
摘要: --透视摄像机local camera = cc.Camera:createPerspective(fieldOfView,aspectRatio,nearPlane,farPlane)--fieldOfView, number 类型 表示透视摄像机视野,通常是40~60度--aspectRatio, number 类型 表示视平面宽/高比例--nearPlane, number 类型 表示近... 阅读全文
posted @ 2017-01-04 14:40 feizuzu 阅读(451) 评论(0) 推荐(0) 编辑
摘要: --自定义事件 --加载EventProctocol组件 --在MainScene:ctor()中 加入如下代码,就可以让MainScene拥有EventProtocol的方法 cc(self):addComponent("component.behavior.EventProtocol"):exportMethods()--exportMethods()function EventProtoc... 阅读全文
posted @ 2017-01-04 14:26 feizuzu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 数组的定义和初始化数组的维数必须用大于等于1的常量表达式 此常量表达式只能包含整形自面值常量,枚举常量 或者用常量表达式初始化的整型const对象显示初始化数组元素cosnt unsigned array_size =3;int ia[array_size]={0,1,2};int ia[]={1,2,3};在函数体外定义的内置数组,初始化为0在函数体外定义的内置数组 无元素初始化不管数组在哪里定... 阅读全文
posted @ 2017-01-04 14:16 feizuzu 阅读(3335) 评论(0) 推荐(0) 编辑
摘要: 安装完luaforwindows后进行配置 配置项目属性 阅读全文
posted @ 2017-01-04 13:08 feizuzu 阅读(289) 评论(0) 推荐(0) 编辑