auto draw = DrawNode::create();
Vec2 rectangle[4];
rectangle[0] = Vec2(50, 50);
rectangle[1] = Vec2(50,100);
rectangle[2] = Vec2(150, 100);
rectangle[3] = Vec2(150, 50);
draw->drawPolygon(rectangle, 4, Color4F::YELLOW, 20.0f, Color4F::ORANGE);
This is what I used to draw a rectangle with DrawNode.
Is drawing an image of a rectangle with sprite or drawing a primitive rectangle with DrawNode more efficient? Let’s assume that the rectangles will look the same in the end.