Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经创建了 CocosNode,然后在这个节点中插入了精灵。我分别移动了节点和精灵。由于结果节点有一些坐标,精灵有另一个坐标。我在屏幕上看到精灵,但精灵的坐标超出了屏幕边框。
那么您能否解释一下如何将精灵坐标转换为屏幕坐标?
谢谢。
Cocos 为此提供了方法。要将节点的位置转换为世界空间(cocos 坐标系,y 向屏幕顶部增加),您可以:
[aSprite convertToWorldSpace:aSprite.position];
要将这个坐标系统转换为 iPhone 视图坐标系统(y 向屏幕底部增加),请执行以下操作:
[[CCDirector sharedDirector] convertToGL:[aSprite convertToWorldSpace:aSprite.position]];
The code below works as is. I want to use this code to display specific Twitch streams based on the page that is loaded.
<script type="text/javascript"> var stream = location.pathn