delay error use of undeclare identifier

  • avante2500
    Likes 0

    Problem Description

    When i try to run this line it gives me error “delay”  use of undeclare identifier:

        auto seq = Sequence::create(moveBy, delay, moveTo, nullptr);

    And another Q whats this means :

    Size visibleSize = Director::getInstance()->getVisibleSize();//is it the visible size of my sprite?
    Vec2 origin = Director::getInstance()->getVisibleOrigin();//is it the origin of the screen W H ?

    background->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));

    gray->getPositionY()


  • Sonar Systems admin
    Likes 0

    Put NULL as the last parameter for Sequence::create instead of nullptr

     

    visibleSize is getting the visible size of the screen, it has nothing to do with the objects on the screen such as sprites, this helps you keep everything that should be on screen visible.

     

    Origin is used because some devices don’t start at (0,0) such as android devices that have on screen buttons so you need to offset positioning.


    This reply has been verified.
  • avante2500
    Likes 0

    That was really helpful. Appreciate ur help and in a couple of months u will c my game on  Both sotres !!!

    1 more thing where i find the Programmer Guide Sample?


  • Sonar Systems admin
    Likes 0

    You can access the Programmers guide at http://cocos.sonarlearning.co.uk/ or by using the Cocos API Guide link in left side bar on this website or from the footer.

Login to reply