官术网_书友最值得收藏!

Project requirements

To quickly set up an AndEngine application, we follow the general procedure of pulling the current AndEngine code from the AndEngine GitHub repository and using it as a library project dependency in our project. We will be using the GLES2-AnchorCenter branch for our project because it's the most current development branch at the time of writing this book. An additional advantage of using the AnchorCenter branch is the main change from the GLES2 branch—it uses the same coordinate system as OpenGL, in the sense that the origin is in the bottom-left part of the screen. This will make our lives easier later on, as it will save us the trouble of having to convert between two different coordinate systems.

Another difference between GLES2 and AnchorCenter is that the former positions new objects by default with the corner as the anchor point, while in the latter's case, the default anchor point is at the center of the object. We can change the anchor point wherever needed, of course, but it's good to be aware of this default behavior when we start positioning objects.

When setting up the new Android project, we target the latest available Android SDK version (4.4.2 at the time of writing this book) and use 2.2 as the minimum SDK version, since this is what GLES2 and the related AnchorCenter branch of AndEngine require. The project we are going to create is just a general, blank Android project without any associated themes or input methods. When presented with the choice to enable any of such options in Eclipse/ADT or another wizard, do not choose any of them. What we need is a blank slate, with only a basic Activity class as the starting point.

During the course of this book, we will use Eclipse/ADT as the development environment. In this IDE, we need to get the AndEngine project imported into the workspace so that in the properties of our new project, we can add it as an Android library dependency. Other development environments will have a similar setup, but we'll leave the details of these as an exercise for you.

主站蜘蛛池模板: 南阳市| 城市| 甘德县| 巴中市| 伊金霍洛旗| 马边| 辽源市| 西和县| 虹口区| 长宁县| 天水市| 鹿邑县| 五原县| 绍兴县| 繁昌县| 虎林市| 浑源县| 古交市| 陇西县| 台北市| 连南| 华容县| 枣阳市| 蒲江县| 阳山县| 兴文县| 苍南县| 攀枝花市| 华蓥市| 灌南县| 达孜县| 石台县| 哈密市| 禹城市| 广宗县| 昂仁县| 潞西市| 兰溪市| 大方县| 红桥区| 阳曲县|