Forums » C++ Framework » Drawing a dotted/dashed line with ccDrawPoly »
| cela lee | Drawing a dotted/dashed line with ccDrawPoly | ||
|---|---|---|---|
|
Added by cela lee about 1 year ago
Hello, I'm trying to draw a dotted/dashed line with ccDrawPoly between 2 or more points, but all I get is a difference in color of the line. Does anyone know if there is something wrong with the code below? @ int numberOfPoints = 5; glDrawArrays(GL_LINES, 0,numperOfPoints); ccDrawPoly(&pointsArray.at(0),pointsArray.size() , false);@ |
||
| Kevin H | RE: Drawing a dotted/dashed line with ccDrawPoly | ||
|
Added by Kevin H about 1 year ago
What you are trying to draw is called "strippled" lines. |
||
| cela lee | RE: Drawing a dotted/dashed line with ccDrawPoly | ||
|
Added by cela lee about 1 year ago
Thanks for your answer I was reading at http://www.cocos2d-iphone.org/forum/topic/4853/page/2 where someone managed to draw dotted lines. But according to your link one should use textures, so I'll take another look in the CCRibbon class which uses a texture and glDrawArrays. Mayby I can use glDrawArrays to draw polygons without textures. I'm quite new to OpgenGl so I was wondering why some OpenGl code is recognized by Cocos2d and some is not if I may ask For instance this statement gives errors:
|
||
| Kevin H | RE: Drawing a dotted/dashed line with ccDrawPoly | ||
|
Added by Kevin H about 1 year ago
OpenGL and OpenGL ES are two different animals. |
||
| cela lee | RE: Drawing a dotted/dashed line with ccDrawPoly | ||
|
Added by cela lee about 1 year ago
Thanks, forgot about that.. You put me in the right direction and now I think I know how to handle proper draws with glDrawArrays and pointers |
(1-4/4)
