TMXTiledMap not showing up in simple game 3.0

Hey guys, I was following this simple tutorial http://www.raywenderlich.com/39113/cocos2d-x-tile-map-tutorial-part-1. I made a simple tmx file and added it to my project. Everything compiles and runs but my screen is showing blank.

bool HelloWorld::init()
{
    if ( !Layer::init() )
    {
        return false;
    }

    Size visibleSize = Director::getInstance()->getVisibleSize();
    Point origin = Director::getInstance()->getVisibleOrigin();

    auto tileMap = cocos2d::TMXTiledMap::create("tileset.tmx");
    //tileMap->setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
    this->addChild(tileMap, 0);

    //auto sprite = Sprite::create("HelloWorld.png");
    //sprite->setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
    //this->addChild(sprite, 0);

    return true;
}

When I debug through I see it finding and loading the file (and see properties of it populating correctly). I tried with and without setting the position. Also to make sure everything was wired up correctly if I run the commented lines out below the image is displayed on the screen with no problems. Any ideas what I am doing wrong? I am using the 3.0 alpha build on windows vs2012. Thanks.

1 Like

OK I’m a moron. It was loading perfectly fine, but it was zooming in on the bottom left of my .tmx file, which was just blank. Therefore all I saw was blank, everything is actually working perfectly.