《如何使用 Cocos2D 2.X 制作基于 Tile 的游戏》使用 cocos2d V3 制作本教程
问题描述
我有一个小问题.在本教程中 如何使用 Cocos2D 2.X 制作基于 Tile 的游戏,使用 cocos2d V2.0,我想在 cocos2d V3.0 中制作.所以,它不起作用!谢谢!(我不会说英语)
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 don't speak english)
我认为这行有问题 - self.position = viewPoint;
I think problem in this line - self.position = viewPoint;
推荐答案
问题是用户交互的区域默认绑定到场景的contentSize
(屏幕大小).
The problem is that the area of the user interaction is by default bound to the contentSize
of the scene (screen size).
当调用 setViewPointCenter
方法时,您将场景位置移出未处理触摸事件的区域.
When calling your setViewPointCenter
method, you are moving the scene position out of this area where the touch event is not handled.
你必须像这样扩展瓦片地图的 contentSize
的这个区域:
You have to extend this area of the contentSize
of the tile map like that :
这篇关于《如何使用 Cocos2D 2.X 制作基于 Tile 的游戏》使用 cocos2d V3 制作本教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!