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

Method TMXOrthoVertexZNew

tests/cpp-tests/Source/TileMapTest/TileMapTest2.cpp:981–1002  ·  view source on GitHub ↗

------------------------------------------------------------------ TMXOrthoVertexZNew ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

979//
980//------------------------------------------------------------------
981TMXOrthoVertexZNew::TMXOrthoVertexZNew()
982{
983 auto map = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test-vertexz.tmx");
984 addChild(map, 0, kTagTileMap);
985
986 Size AX_UNUSED s = map->getContentSize();
987 AXLOGD("ContentSize: {}, {}", s.width, s.height);
988
989 // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you
990 // can use any Sprite and it will work OK.
991 auto layer = map->getLayer("trees");
992 _tamara = layer->getTileAt(Vec2(0, 11));
993 AXLOGD("{} vertexZ: {}", fmt::ptr(_tamara), _tamara->getPositionZ());
994 _tamara->retain();
995
996 auto move = MoveBy::create(10, Vec2(400, 450) * (1 / AX_CONTENT_SCALE_FACTOR()));
997 auto back = move->reverse();
998 auto seq = Sequence::create(move, back, nullptr);
999 _tamara->runAction(RepeatForever::create(seq));
1000
1001 schedule(AX_SCHEDULE_SELECTOR(TMXOrthoVertexZNew::repositionSprite));
1002}
1003
1004TMXOrthoVertexZNew::~TMXOrthoVertexZNew()
1005{

Callers

nothing calls this directly

Calls 10

createFunction · 0.85
getLayerMethod · 0.80
getPositionZMethod · 0.80
Vec2Function · 0.50
ptrFunction · 0.50
getContentSizeMethod · 0.45
getTileAtMethod · 0.45
retainMethod · 0.45
reverseMethod · 0.45
runActionMethod · 0.45

Tested by

no test coverage detected