玩玩cocos2d-x(1)

来源:互联网 发布:南通大学网络公选课 编辑:程序博客网 时间:2024/06/07 06:59

今天看了http://4137613.blog.51cto.com/4127613/754729这篇文章,尝试在我的hello world里面进行绘图,重载draw函数后编写如下代码:

glColor4f(1.0, 1.0, 0.0, 1.0); 
glLineWidth(10);
ccDrawLine( CCPointMake(0, 0), CCPointMake(s.width, s.height) ); 

未果,去掉this->addChild(pSprite, 0);后成功显示了。


背景精灵盖住了绘图~

原创粉丝点击