如何用 Cocos2d-iPhone 画线
问题描述
我试图通过完成简单的事情来掌握 Cocos2d.此时,我有一个场景,该场景有一个背景精灵和一个图层.我正在尝试使用 drawLine 绘制到图层上.这是我目前的尝试.
I'm trying to get to grips with Cocos2d by trying to accomplish simple things. At this point, I have a scene, that scene has a background sprite, and a Layer. I'm trying to draw onto the Layer using drawLine. Here's my current attempt.
这会产生错误空值没有被忽略,因为它应该是".所以很明显我做错了,但希望你能看到我的推理.
Which generates the error "void value not ignored as it ought to be". So obviously I'm doing it wrong, but hopefully you can see my reasoning.
我也试过了
这不会给我一个错误,但它也不起作用.我意识到我没有理解一些基本的东西,但是谁能引导我朝着正确的方向前进?
Which doesn't give me an error, but it doesn't work either. I realise I'm not understanding something fundamental, but can anyone steer me in the right direction?
推荐答案
来自cocos2d drawPrimitivesTest.m:
From the cocos2d drawPrimitivesTest.m:
这篇关于如何用 Cocos2d-iPhone 画线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!