绘制 cocos2d v3 不再有 ccDraw* 功能,不制作节点如何绘制?
问题描述
我按照 http://www.cocos2d-swift.org/get-started 上的说明进行操作
并通过 Sprite Builder 创建了一个新项目.
and made a new Project through Sprite Builder.
搜索 ccDraw 没有显示任何内容.我在论坛上找到了这个例子,并实现了,但它看起来不正确.我不想要一个对资源征税的drawNode.我想要 ccDrawLine 过去如何工作的低级 GL 绘图线.当我做这样的 drawNode 时——它不会重置旧的绘图——所以我画的所有线条都留在屏幕上.
searching for ccDraw doesn't show anything. I found this example on a forum, and implemented, but it doesn't look right. I don't want a drawNode that taxes resources. I want low level GL drawing line how ccDrawLine used to work. When I do a drawNode like this -- it doesn't reset the old drawing -- so all lines I draw stay on the screen.
如何像在 v2.x 中一样进行绘制?(ccDrawLine, ccDrawCircle, ccDrawPoly)
How do I draw like in v2.x? (ccDrawLine, ccDrawCircle, ccDrawPoly)
http://www.cocos2d-swift.org/docs/api/Classes/CCDrawNode.html 建议使用 CCDrawNode 效率不高.
http://www.cocos2d-swift.org/docs/api/Classes/CCDrawNode.html suggests using a CCDrawNode is not efficient.
推荐答案
简单修改pulse如下,去掉draw
覆盖.
simply modify pulse slightly as follows, and get rid of the draw
override.
这篇关于绘制 cocos2d v3 不再有 ccDraw* 功能,不制作节点如何绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!