引用本文请注明来源: http://yhz61010.iteye.com/blog/1939144

什么是 libgdx
它是一个免费的游戏开发框架。强调一下,libgdx 不是一个游戏引擎(engine),而一个开发框架(framework),用它可以写出一个游戏引擎(例如,AndEngine)。这一点官网上写的很清楚! 引用 https://code.google.com/p/libgdx/wiki/GoalsFeatures#What_libgdx_is
https://code.google.com/p/libgdx/wiki/GoalsFeatures#What_libgdx_is_not
除此之外,关于什么是 libgdx 大家可以 Google 或 Baidu 一下。不过在这里我还是要引用下官网原文: 引用 引用地址: https://code.google.com/p/libgdx/#What_is_libgdx?
Libgdx is a cross-platform game development library written in Java, with some JNI code for performance hungry sections. It abstracts away the differences between writting desktop, Android, iOS and HTML5 games based on standards like OpenGL ES/WebGL. Applications can be prototyped and developed entirely on the desktop, then only 6 lines of code are needed to run your app on Android or HTML5.
其它官网引文:
https://code.google.com/p/libgdx/wiki/Introduction#Introduction

大致翻译一下啊:
Libgdx 是使用 Java 写的一个跨平台的游戏开始框架,对于性能要求高的部分使用了 JNI 代码编写(C/C++)。它对不同平台(桌面,Android,iOS 和 HTML5)之间的写法差异进行了抽象(例如基于标准的 OpenGL ES/WebGL)。你的应用原型开发可以完全在桌面平台上进行,然后仅通过 6 行代码,就可以让你的应用运行在 Android 或 HTML5 上。

官网地址
https://code.google.com/p/libgdx/
下载地址
https://code.google.com/p/libgdx/downloads/list
源码及示例
https://github.com/libgdx/libgdx


示例代码的运行
以 libgdx 0.9.8 版本为例进行说明。
以官方 superjumper 为例进行说明。
1. 从官网下载 superjumper 例子。
下载地址:
https://github.com/libgdx/libgdx/tree/master/demos/superjumper

2. 将 superjumper-android 和 superjumper 导入到 Eclipse 中。

3. 在 Eclipse 中,右键点击 superjumper 项目 -> Properties -> Java Build Path -> Projects 在此移除有错的 Projects。之后再点击 Libraries 标签,引用如下 4 个 jar:
gdx.jar
gdx-natives.jar
gdx-backend-lwjgl.jar
gdx-backend-lwjgl-natives.jar

4. 运行桌面版程序。
右键点击 superjumper 项目 -> Run AS -> Java Application,然后选择主类 SuperJumperDesktop。
恭喜你,你的桌面版 superjumper 已经可以运行了。

5. 运行 Android 版本程序。(以 Eclipse ADT 版本 22.0.5 为例进行说明)
a) superjumper-android 项目的 libs 文件夹下,引用如下 2 个 jar 包:
gdx.jar
gdx-backend-android.jar
b) 右键点击 superjumper-android 项目 -> Properties -> Java Build Path -> Projects 移除有错的 Projects并添加 superjumper 到本项目(若已经添加则不用重复添加)。
c) 之后再点击 Order and Export 标签,选中 superjumper,并将它移动到最上面。
此时你的项目应该没有出现任何错误提示。此时你就可以在模拟器或真机中调试你的应用了。

更多相关文章

  1. webrtc服务器janus android客户端编译学习三
  2. Android混合开发之------ AndroidStudio集成Cordova项目
  3. 【项目架构】Android(安卓)MVP 和MVVM框架模式 学习实例Demo之mv
  4. 第一个android 程序的学习心得
  5. Android(安卓)studio 使用ndk开发JNI
  6. 第五章 Android加载PDF文件的使用
  7. 在Android中applicationId与package name的那些事
  8. 下载Android单个项目源码的方法
  9. Android适配之dimens适配终极攻略(实际项目中应用方案)

随机推荐

  1. Android 上调试 webkit framework 层及jn
  2. MPAndroidChart介绍
  3. Android鸳鸯刀之DatePicker、TimePicker
  4. Android异步HTTP请求框架Volley的使用
  5. Android Out Of Memory(OOM) 的详细研究
  6. android 怎么进行调试程序 如何采用Andro
  7. Android(安卓)时间戳和日期之间的转化
  8. Android WebView CPU高负荷问题
  9. Android创世纪 第三天
  10. Android中通过EventBus传递消息数据