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.
下面是一个著名的建筑游戏的截图。
如您所见,杆与球形接头连接在一起。我正在尝试在 iPhone 上实现与 Cosos2d 类似的功能。我这里有两个问题:
我不确定什么是最好的方法。我想无论哪种方式都可以,但是通过绘制它们来实现您想要的任何视觉效果都会更加困难。我认为最难的部分是确保它们锚定到具有您想要的尺寸的网格系统中的顶点。
至于(2),您始终可以缩放图像。
CCSprite *rod = [CCSprite spriteWithFile:@"rod.png"]; rod.scaleY = 2.0; //or scaleX
然后根据需要旋转并更改其锚点。
我再次想象最困难的部分是锚定它们并正确定位它们,以便与顶点正确对齐。