Premise
Hello, after trying to understand the reason of this annoying error for all the weekend i surrender and ask it here, i hope you won’t mind to much. I have no deep understanding of cocos and it might and most certainly is a banality, but google has no answers apparently for this particular issue.
What’s wrong?
The problem is simple: if i draw a sprite or a text, is in hd. If i draw a square or a rectangle tilted, the rectangle shows the saw-like teeth usually related to a low definition.
I’ve tried to define the anti-aliasing for the DrawNode elements, no success.
I’ve also tried to sed manually the definition for my device, but still no success.
Here’s an image of the problem:
As you can see, the red polygon is with a low definition upper side.
##The code
Here’s the code, very simple and commented to the bones:
// Defining array of angles of the new background element
Point vertices[4];
// Starting Height of new background element
float startHeight = 100;
// Ending Height of new background element
float endHeight = 200;
// Color of the background element, a strong red
Color4F color = Color4F(1, 0, 0, 1);
// Define the new polygon
DrawNode* polygon = DrawNode::create();
// First Point
vertices[0] = Vec2(0, startHeight);
// Second point
vertices[1] = Vec2(visibleSize.width, endHeight);
// Third Point
vertices[2] = Vec2(visibleSize.width, 0);
// Forth Point
vertices[3] = Vec2(0, 0);
// Print the polygon
polygon->drawPolygon(vertices, 4, color, 0, Color4F(0, 0, 0, 0));
addChild(polygon);
If anything else might be useful to understand the nature of the problem, ask it and i’ll add it to this question asap.