最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

cocos2d

运维笔记admin33浏览0评论

cocos2d

cocos2d

cocos2d-x tilesMap创建返回null?(cocos2d-x tiledMap create return null?)

我目前正在关注cocos2d-x平铺地图上的Ray教程,而我的非常简单的代码根本不起作用。

所以这是我的代码,

_tileMap = TMXTiledMap::create("TileMap.tmx");this->addChild(_tileMap);

并且根据调试器,_tileMap为null,这会导致addChild方法崩溃。

有谁知道为什么会这样?

ps _tileMap在标题中声明为TMXTiledMap *,TileMap.tmx完全填充了东西,TileMap.tmx以及使用创建文件夹引用将其他内容导入资源文件夹。

I am currently following Ray's tutorial on cocos2d-x tile map and my very simple code is not working at all.

So here is my code,

_tileMap = TMXTiledMap::create("TileMap.tmx");this->addChild(_tileMap);

and according to the debugger, _tileMap is null, which causes a crash on the addChild method.

Do anyone have any idea why this is happening?

p.s _tileMap is declared as a TMXTiledMap* in header, TileMap.tmx is totally filled with stuff and TileMap.tmx along with other things are imported into the resource folder using creating folder reference.

最满意答案

您是否尝试使用“Base64(未压缩)”的“Tile图层格式”?

我和你一样有同样的症状,但是我从库存中通过更改瓦片层格式从库存到Base64(未压缩)。

在此处输入图像描述

Have you try "Tile layer format" with "Base64(uncompressed) ?

I have same symptom as like you, but I get out from stock by change tile layer format from cvs to Base64(uncompressed).

enter image description here

发布评论

评论列表(0)

  1. 暂无评论