Android 在 Eclipse 中安装 AndEngine

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10713315/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:43:07  来源:igfitidea点击:

Installing AndEngine in Eclipse

androideclipseandengine

提问by KodiakBear211

I'm wanting to install AndEngine... I've came across Some videos that show you how to install it. But these videos were done last year, and since then, the method of installing it has changed. At lest the way they were doing it in these videos... Dose any one know the new extensions or some new tutorials I can follow...

我想安装 AndEngine... 我遇到了一些向您展示如何安装它的视频。但这些视频是去年完成的,从那时起,安装方法发生了变化。至少他们在这些视频中是这样做的……有人知道我可以遵循的新扩展或一些新教程吗……

回答by Jimmar

Keep in mind that currently there are 2 versions of AndEngine GLES1 and GLES2, most videos and tutorials are for GLES1 as that GLES2 was recently released also AndEngine was on google Code and now moved to github , so an old tutorial would not work I wrote a tutorial about setting up GLES2 and getting it to work , check it out

请记住,目前有 2 个版本的 AndEngine GLES1 和 GLES2,大多数视频和教程都是针对 GLES1 的,因为最近发布了 GLES2 并且 AndEngine 在 google Code 上,现在移到了 github ,因此旧教程不起作用我写了一个有关设置 GLES2 并使其工作的教程,请查看

https://jimmaru.wordpress.com/2012/04/23/setting-up-andengine-gles2-0/

https://jimmaru.wordpress.com/2012/04/23/setting-up-andengine-gles2-0/

回答by Plastic Sturgeon

The current best practice is to set up andengine as a library project. Nicholas Gramlich, the authro of andengine, posts instructions on how to download the latest build of andengine and add it to eclipse a s a library project here:

当前的最佳实践是将 andengine 设置为库项目。andengine 的作者 Nicholas Gramlich 在此处发布了有关如何下载 andengine 的最新版本并将其添加到 eclipse asa 库项目的说明:

http://www.andengine.org/forums/gles2/use-andengine-as-a-android-library-project-not-as-a-jar-t6142.html

http://www.andengine.org/forums/gles2/use-andengine-as-a-android-library-project-not-as-a-jar-t6142.html

You do notwant to get a jar file and use that. Because there is no .jar for andengine anymore. If you are using a jar file, you are using an old version. Even if you are using GLES1, you should update to the latest code via a library project, and NOT a jar file.

希望得到一个jar文件并使用它。因为不再有 andengine 的 .jar 文件了。如果您使用的是 jar 文件,则您使用的是旧版本。即使您使用的是 GLES1,您也应该通过库项目而不是 jar 文件更新到最新代码。

回答by lukasz

I see this is still not well explained. So i did it myself. This is my way:

我看到这仍然没有很好地解释。所以我自己做了。这是我的方式:

  1. Create your game project in Eclipse (do it as usual)
  2. Download and unpack andengine from github to and_location(not a jar file)
  3. In eclipse import whole and_locationfolder as an "Existing Android Code.." to do so right click on white space in project view and choose "Import" from context menu. As a root directory choose and_locationwhen u do this it should (by default) mark checkbox next to "AndEngine" project. Click Finish.
  4. Now you will see two projects in your workspace:
    • YourGame
    • AndEngine
  5. Right click on YourGame project and choose "Build path -> Configure build path.."
  6. Choose "Projects" tab
  7. Click "Add" button on the right. Choose AndEngine, Click OK -> OK and Voila, you are done and you can use AndEngine classes in your project
  1. 在 Eclipse 中创建您的游戏项目(照常进行)
  2. 从github下载andengine并解压到and_location(不是jar文件)
  3. 在 Eclipse 中,将整个and_location文件夹导入为“Existing Android Code..”,右键单击项目视图中的空白区域,然后从上下文菜单中选择“Import”。作为根目录选择and_location当你这样做时,它应该(默认情况下)标记“AndEngine”项目旁边的复选框。单击完成。
  4. 现在,您将在工作区中看到两个项目:
    • 你的游戏
    • 和引擎
  5. 右键单击 YourGame 项目并选择“构建路径 -> 配置构建路径..”
  6. 选择“项目”选项卡
  7. 单击右侧的“添加”按钮。选择 AndEngine,点击 OK -> OK and Voila,你就完成了,你可以在你的项目中使用 AndEngine 类

回答by itechDroid

basically you just want to add jar file in ur project .so first download jar file from http://www.2shared.com/file/9K77Yazm/andengine.htmland now you can include this jar file in your project like this rightclick on ur project->properties->javabuildpath->add external jar->give the location of download and jar and add it.

基本上你只想在你的项目中添加 jar 文件。所以首先从http://www.2shared.com/file/9K77Yazm/andengine.html下载 jar 文件,现在你可以在你的项目中包含这个 jar 文件,就像这样右键单击你的项目->属性->javabuildpath->添加外部jar->给出下载和jar的位置并添加。