Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Drawing primitives in Cocos2d-x


One of the main elements in the game is the LineContainer.cpp class. It is a DrawNode derived class that allows us to draw lines and circles on the screen.

DrawNode comes bundled with a list of drawing methods you can use to draw lines, points, circles, polygons, and so on.

The methods we'll use are drawLine and drawDot.