------------------------------------------------------------------ TMXOrthoVertexZNew ------------------------------------------------------------------
| 979 | // |
| 980 | //------------------------------------------------------------------ |
| 981 | TMXOrthoVertexZNew::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 | |
| 1004 | TMXOrthoVertexZNew::~TMXOrthoVertexZNew() |
| 1005 | { |
nothing calls this directly
no test coverage detected