Book Image

Cocos2d-x Cookbook

By : Akihiro Matsuura
Book Image

Cocos2d-x Cookbook

By: Akihiro Matsuura

Overview of this book

Table of Contents (18 chapters)
Cocos2d-x Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Physics Editor


In Chapter 9, Controlling Physics, you learned about Physics Engine. We can create physics bodies to use Cocos2d-x API. However, we can only create a circle shape or a box shape. Actually, you have to use complex shapes in real games. In this recipe, you will learn how to create a lot of shapes using Physics Editor.

Getting ready

Physics Editor is created by the same company that created Texture Packer. Physics Editor is a paid application. But you can use a free trial version. If you don't have it, you can download it by visiting the https://www.codeandweb.com/physicseditor

Here, you prepare the image to use this tool. Here, we will use the following image that is similar to a gear. This image's name is gear.png.

How to do it...

First of all, you will create a physics file to use Physics Editor.

  1. Launch Physics Editor. Then, drag the image gear.png to the left pane.

  2. Click on the shaper tracer icon that is the third icon from the left in the tool bar. The shaper tracer icon...