-
Notifications
You must be signed in to change notification settings - Fork 0
Using libgdx with Scala
Scala is a functional, object-oriented programming language for the JVM that works seamlessly with Java libraries, frameworks, and tools. It has a concise syntax and a REPL, which makes it feel like a scripting language, but it is being used in mission critical server software at companies like Twitter and LinkedIn.
Although Scala and Java code can be freely mixed, the standard tooling for working with Scala is quite different than what Java developers will be used to. There is a project, libgdx-sbt-project, that provides a simple path for getting started with libgdx and Scala using standard build tools and best practices.
This tutorial assumes you have installed g8 and sbt 0.12, which are used in the Scala community for generating and interacting with projects.
In your favourite shell type:
$ g8 ajhager/libgdx-sbt-project.g8
After filling in some information about your project, you can start placing your game's source files and assets in common/src/main/scala and common/src/main/resources, respectively.
Update to the latest libraries:
$ sbt
> update
Run the desktop project:
> desktop/run
Package the desktop project into single jar:
> assembly
Run the android project on a device:
> android/start
Visit android-plugin for a more in-depth guide to android configuration and usage.
Run the ios project on a device:
> ios/device
Visit sbt-robovm for a more in-depth guide to ios configuration and usage.
Run all unit tests from desktop, android and common (subdirectories src/test/scala):
> test
Run specific set of unit tests:
> common/test
In most cases you will be able to open and edit each sub-project (like common, android or desktop), but you still need to use SBT to build the project.
See here for details about sbt plugins for each editor.
-
开发者指南
- Introduction
- 设置开发环境 (Eclipse, Intellij IDEA, NetBeans)
- 创建、运行、调试、打包你的项目
- 源码
- The Application Framework
- A Simple Game
- File Handling
- Networking
- Preferences
- Input Handling
- Memory Management
- Audio
-
Graphics
- Configuration & Querying Graphics ??
- Fullscreen & VSync
- Continuous & Non-Continuous Rendering
- Clearing the Screen
- Take a Screenshot
- Profiling
- Viewports
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprites * 2D Animation * Clipping, with the use of ScissorStack * Orthographic camera * Mapping Touch Coordinates ?? * NinePatches * Bitmap Fonts * Distance field fonts * Color Markup Language * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * Texture Compression * 2D Particle Effects * Tile Maps * scene2d * scene2d.ui * Table * Skin
- 3D Graphics * Quick Start * Models * Material and environment * ModelBatch * ModelBuilder, MeshBuilder and MeshPartBuilder * 3D animations and skinning * Importing Blender models in LibGDX * 3D Particle Effects * Perspective Camera ?? * Picking ?? * Decals
- Managing Your Assets
- Internationalization and Localization
- 实用程序
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- 工具
- 扩展
- Artificial Intelligence
- gdx-freetype
-
Physics
* Box2D
* Bullet Physics * [Setup](../Bullet Wrapper - Setup) * [Using the wrapper](../Bullet Wrapper - Using the wrapper) * [Using models](../Bullet Wrapper - Using models) * [Contact callbacks](../Bullet Wrapper - Contact callbacks) * [Custom classes](../Bullet Wrapper - Custom classes) * [Debugging](../Bullet Wrapper - Debugging)
- Using libgdx with other JVM languages
- Third Party Services
- 文章