To work, draw a line to connect the center of the screen and the touch point. The line must be thick and be able to adjust zOrder flexibly. Under this requirement, I first used glLineWidth (10) and DrawPrimitives: drawLine (......) The draw method is rewritten to implement this function. However, it was found that the glLineWidth and 10-200 of the kill were not changed.
To work, draw a line to connect the center of the screen and the touch point. The line must be thick and be able to adjust zOrder flexibly. Under this requirement, I first used glLineWidth (10) and DrawPrimitives: drawLine (......) The draw method is rewritten to implement this function. However, it was found that the glLineWidth and 10-200 of the kill were not changed.
To work, draw a line to connect the center of the screen and the touch point. The line must be thick and be able to adjust zOrder flexibly.
Under this requirement, I first used
GlLineWidth (10) and DrawPrimitives: drawLine (......) The draw method is rewritten to implement this function.
However, it was later found that the glLineWidth and 10-200 of the kill had not changed, and later it was found that the line drawn would be blocked by the genie.
Even if zOrder of the genie is set to a negative number.
I had no choice but to start my journey to Baidu. I found DrawNode on the Forum and tried it. It worked really well.
DrawNode uses the drawn image as a Node in the program. It can adjust zOrder as freely as other nodes, and there is no limit on the width of OpenGL at 10 points. However, DrawNode does not erase the image left by the previous frame. Therefore, we need a global pointer and refresh it manually.
The following code is used:
OK. After such processing, the line width can be adjusted as needed.
Let's take a look at the Super rough line !!