我在lua文件里面,的错误代码如下
local bg = CCSprite:create(“res/menu1.png”)
layer:addChild(bg)
图片文件找到了但是问题出来了啊,如图
用的什么引擎版本呀。:867:
HelloWorld能正常跑起来吗?
有修改有引擎的源码吗?
把运行窗口的时候打印出来的log都贴出来(主要是那些GL信息)。
在官网下的啊,最新的吧
您好!!系统的可以运行啊
我的代码:
–场景类
function Main()
local self = cc.Scene:create()
local layer
–初始化layer
local function init()
layer = cc.Layer:create()
self:addChild(layer)
local bg = CCSprite:create(“res/menu1.png”)
layer:addChild(bg)
end
init()
return self
end
–屏幕配置
local function __main()
local director = cc.Director:getInstance()
director:runWithScene(Main())
local glview = director:getOpenGLView()
if nil == glview then
glview = cc.GLView:createWithRect(“HelloLua”, cc.rect(0,0,800,600))–窗口大小
director:setOpenGLView(glview)
end
--适配方案
glview:setDesignResolutionSize(800, 640, cc.ResolutionPolicy.NO_BORDER)--分辨率
--turn on display FPS
director:setDisplayStats(true)
--set FPS. the default value is 1.0/60 if you don't call this
director:setAnimationInterval(1.0 / 60)
end
–运行
__main()
不是这个,用XCode跑,会出来一个这样的信息。
cocos2d:
{
gl.supports_vertex_array_object: true
cocos2d.x.version: cocos2d-x 3.2
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple Software Renderer
cocos2d.x.compiled_with_profiler: false
gl.max_texture_size: 4096
gl.supports_ETC1: false
gl.supports_BGRA8888: false
cocos2d.x.build_type: DEBUG
gl.supports_discard_framebuffer: true
gl.supports_NPOT: true
gl.supports_ATITC: false
gl.max_samples_allowed: 4
gl.max_texture_units: 8
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_S3TC: false
gl.version: OpenGL ES 2.0 APPLE-10.1.5
}
不好意思啊,我用的w7下的vs啊,不是xcode
VS也有这个。
不是应该cc.Sprite:create()?为什么你的是CCSprite:create()
2.x版的是这样。