Cocos2dx (12)

Source: Internet
Author: User
Study Notes on cocos2d-x (12) -- Drawing
14:40:08 let me say two
Add to favorites I want to contribute
[Font: small and big]

Cocos2d-x encapsulates some OpenGL methods for drawing basic graphics, and test has corresponding examples

1. Draw points. The vertices in this engine are square points. The parameters are coordinate points or coordinate arrays.

 

2. draw a straight line. The parameter is the start point and the end point. You can set the line width and brush.

 

3. Circle. The parameter is the center of the circle, the radius, the angle, and the number of segments (the circle is a straight line)

 

4. Draw a polygon. The parameter is the Dot Array, the number of vertices, and whether the image is closed.

 

5. Draw a beiser curve. The first example is a control point. The second example is two control points. The last parameter is the number of segments.

 

Finally, remember to restore the OpenGL value Because OpenGL is a state machine.

 

I just started to study this engine. If there are any errors, I hope you can correct them more.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.