“How To Make a Tile-Based Game with Cocos2D 2.X” Make this tutorial with cocos2d V3

后端 未结 1 491
猫巷女王i
猫巷女王i 2021-01-22 12:07

I have a small problem. In this tutorial How To Make a Tile-Based Game with Cocos2D 2.X used cocos2d V2.0, I wanna make this in cocos2d V3.0. So, it doesn\'t work! Thanks! (I do

1条回答
  •  执念已碎
    2021-01-22 12:51

    The problem is that the area of the user interaction is by default bound to the contentSize of the scene (screen size).

    When calling your setViewPointCenter method, you are moving the scene position out of this area where the touch event is not handled.

    You have to extend this area of the contentSize of the tile map like that :

    [self setContentSize:[_tileMap contentSize]];
    self.userInteractionEnabled = YES;
    

    0 讨论(0)
提交回复
热议问题