MCPcopy Create free account
hub / github.com/axmolengine/axmol / initWithTileFile

Method initWithTileFile

core/2d/TileMapAtlas.cpp:53–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53bool TileMapAtlas::initWithTileFile(std::string_view tile, std::string_view mapFile, int tileWidth, int tileHeight)
54{
55 this->loadTGAfile(mapFile);
56 this->calculateItemsToRender();
57
58 if (AtlasNode::initWithTileFile(tile, tileWidth, tileHeight, _itemsToRender))
59 {
60 this->updateAtlasValues();
61 this->setContentSize(Vec2((float)(_TGAInfo->width * _itemWidth), (float)(_TGAInfo->height * _itemHeight)));
62 return true;
63 }
64 return false;
65}
66
67TileMapAtlas::TileMapAtlas() : _itemsToRender(0), _TGAInfo(nullptr) {}
68

Callers 1

createMethod · 0.45

Calls 5

loadTGAfileMethod · 0.95
updateAtlasValuesMethod · 0.95
Vec2Class · 0.70
setContentSizeMethod · 0.45

Tested by

no test coverage detected