Applying Zoom Effect In cocos2D gaming environment?

后端 未结 4 1403
抹茶落季
抹茶落季 2021-01-30 11:39

I\'m working on a game with cocos2D game engine and make load all the sprites while it load the level, now as because some of sprites (obs

4条回答
  •  梦谈多话
    2021-01-30 12:30

    this code scale my Layer by 2 to specific location

        [layer setScale:2];
        layer.position=ccp(240/2+40,160*1.5);
        double dx=(touchLocation.x*2-240);
        double dy=(touchLocation.y*2-160);
        layer.position=ccp(inGamePlay.position.x-dx,inGamePlay.position.y-dy);
    

提交回复
热议问题