Cocos2d-x Study Notes (13) (draw drawing)

Source: Internet
Author: User
The GL status is enabled by default and does not need to be set again. Glableclientstate (GL_VERTEX_ARRAY) glableclientstate (GL_COLOR_ARRAY) glableclientstate (gradient) GL_TEXTURE_2D) commonly used graphic plotting functions are as follows: 1. ccDrawColor4B (GLubyter, GLubyte

The GL status is enabled by default and does not need to be set again. Glableclientstate (GL_VERTEX_ARRAY) glableclientstate (GL_COLOR_ARRAY) glableclientstate (gradient) GL_TEXTURE_2D) commonly used drawing graphics functions are as follows: 1. ccDrawColor4B (GLubyte r, GLubyte

The GL status is enabled by default and does not need to be set again.

GlEnableClientState (GL_VERTEX_ARRAY)

Glableclientstate (GL_COLOR_ARRAY)

Glableclientstate (GL_TEXTURE_COORD_ARRAY)

Glable (GL_TEXTURE_2D)

Common graphic functions are as follows:

1. ccDrawColor4B (GLubyte r, GLubyte g, GLubyte B, GLubyte a) // set the painting color

Parameter 1: red

Parameter 2: green component

Parameter 3: Blue

Parameter 4: Transparency

2. glLineWidth (GLfloat width) // you can specify the line width.

3. ccDrawLine (const CCPoint & origin, const CCPoint & destination) // draw a straight line

Parameter 1: Start Coordinate

Parameter 2: terminal Coordinate

4. ccPointSize (GLfloat pointSize) // you can specify the size of each vertex.

5. ccDrawPoint (const CCPoint & point) // draw a point

6. ccDrawCircle (const CCPoint & center, float radius, float angle, unsigned int segments, bool drawLineToCenter) // draw a circle

Parameter 1: Center Coordinate

Parameter 2: radius Length

Parameter 3: Circular Angle

Parameter 4: Angle

Parameter 5: Count

7. ccDrawPoly (const CCPoint * poli, unsigned int numberOfPoints, bool closePolygon) // draw a hollow Polygon

Parameter 1: vertex Array

Parameter 2: Number of points

Parameter 3: whether to automatically close a polygon

8. ccDrawSolidRect (CCPoint orgin, CCPoint destination, ccColor4F color) // draw a filled rectangle

9. ccDrawRect (CCPoint origin, CCPoint destination) // draw a hollow rectangle

10. ccdrawquadbezr (const CCPoint & origin, const CCPoint & control, const CCPoint & destination, unsigned int segments) // plot the besell Curve

Parameter 1: Start Point

Parameter 2: Control Point

Parameter 3: End Point

Parameter 4: Number of vertices

11. ccdrawcubes (const CCPoint & origin, const CCPoint & control1, const CCPoint & control2, const CCPoint & destination, unsigned int destinations)

// Draw a three-dimensional besell Curve

Parameter 1: Start Point

Parameter 2: Control Point 1

Parameter 3: Control Point 2

Parameter 4: End Point

Parameter 5: Number of vertices

Related Article

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.