Tiled Layer层空报错问题
来源:互联网 发布:李子树下埋死人 知乎 编辑:程序博客网 时间:2024/06/07 02:38
<1>
TMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo){ TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); if (!tileset) {//added by DehengXu return nullptr; } TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo); // tell the layerinfo to release the ownership of the tiles map. layerInfo->_ownTiles = false; layer->setupTiles(); return layer;}
<2>
void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo){ _mapSize = mapInfo->getMapSize(); _tileSize = mapInfo->getTileSize(); _mapOrientation = mapInfo->getOrientation(); _objectGroups = mapInfo->getObjectGroups(); _properties = mapInfo->getProperties(); _tileProperties = mapInfo->getTileProperties(); int idx=0; auto& layers = mapInfo->getLayers(); for(const auto &layerInfo : layers) { if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); if (child == nullptr) {//added by DehengXu continue; } addChild(child, idx, idx); // update content size with the max size const Size& childSize = child->getContentSize(); Size currentSize = this->getContentSize(); currentSize.width = std::max( currentSize.width, childSize.width ); currentSize.height = std::max( currentSize.height, childSize.height ); this->setContentSize(currentSize); idx++; } }}<3>
// privateTMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo){ TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); if (!tileset) {//added by DehengXu return nullptr; } TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo); // tell the layerinfo to release the ownership of the tiles map. layerInfo->_ownTiles = false; layer->setupTiles(); return layer;}<4>
void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo){ _mapSize = mapInfo->getMapSize(); _tileSize = mapInfo->getTileSize(); _mapOrientation = mapInfo->getOrientation(); _objectGroups = mapInfo->getObjectGroups(); _properties = mapInfo->getProperties(); _tileProperties = mapInfo->getTileProperties(); int idx=0; auto& layers = mapInfo->getLayers(); for(const auto &layerInfo : layers) { if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); if (child == nullptr) {//added by DehengXu continue; } addChild(child, idx, idx); // update content size with the max size const Size& childSize = child->getContentSize(); Size currentSize = this->getContentSize(); currentSize.width = std::max( currentSize.width, childSize.width ); currentSize.height = std::max( currentSize.height, childSize.height ); this->setContentSize(currentSize); idx++; } }}
0 0
- Tiled Layer层空报错问题
- Tiled map导入问题
- Tiled
- 关于Layer的问题
- layer插件问题
- Tiled编辑器不能打开.tmx文件的问题
- layer.borderWidth 边框粗细问题
- Unity--关于Layer的问题
- layer mobile的使用问题
- layer框架注意路径问题
- layer
- layer
- layer
- layer
- layer
- layer
- layer
- Tiled Background
- SpringMvc + Quarzt 动态执行任务实现过程
- pig的 Replicated Join 失败
- android 自定义控件字体,解决字体偏移,卡顿,代码重复等问题
- Pig的一个小问题 (filter之后 没有数据)
- Python学习之语句、列表
- Tiled Layer层空报错问题
- 无题
- MFC打开一个文件
- cocos2dx实现电脑Enter、Escape、方向键的响应
- IllegalArgumentException异常
- BloomFilter
- C++ 基础知识
- [LeetCode][Java] Palindrome Number
- 正则表达式基本语法