https://github.com/joafalves/pixel-community
High performance and modular Java/Kotlin 2D Game Framework.
https://github.com/joafalves/pixel-community
framework game-2d game-development game-engine game-engine-2d game-framework gamedev java jvm kotlin lwjgl opengl
Last synced: 8 months ago
JSON representation
High performance and modular Java/Kotlin 2D Game Framework.
- Host: GitHub
- URL: https://github.com/joafalves/pixel-community
- Owner: joafalves
- License: apache-2.0
- Created: 2020-12-12T17:08:34.000Z (over 5 years ago)
- Default Branch: devel
- Last Pushed: 2025-06-22T14:55:01.000Z (9 months ago)
- Last Synced: 2025-06-22T15:42:16.164Z (9 months ago)
- Topics: framework, game-2d, game-development, game-engine, game-engine-2d, game-framework, gamedev, java, jvm, kotlin, lwjgl, opengl
- Language: Java
- Homepage: https://discord.gg/mz56tJJU8t
- Size: 17.4 MB
- Stars: 28
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README


## Pixel Framework ##
### What is this repository for? ###
This repository contains the Pixel Framework and associated modules/dependencies.
### Description ###
The Pixel Framework aims to provide a high performance and lightweight OpenGL 2D game development workflow. It is
influenced by the popular XNA framework and is built on top of the [LWJGL](https://www.lwjgl.org/) (Desktop) and OpenGL ES (Android).
> :book: For practical details on how to use this framework, please check the [wiki page](https://github.com/joafalves/pixel-community/wiki).
Pixel is designed to be modular and easy to extend. Check
[here](https://github.com/joafalves/pixel-community/wiki/E.-Extensions-Overview) for more details on how to use the
available extensions (or how to create your own).
### Examples ##
Check the :file_folder: [demos folder](https://github.com/joafalves/pixel-community/tree/devel/demos) for examples.
##### Basic example (Drawing a Sprite) #####
```java
public class SingleSpriteDemo extends Game {
private Camera2D gameCamera;
private ContentManager content;
private SpriteBatch spriteBatch;
private Texture spriteTex;
public SingleSpriteDemo(GameWindowSettings settings) {
super(settings);
}
@Override
public void load() {
// load up of resources and game utilities:
content = ServiceProvider.get(ContentManager.class);
spriteBatch = ServiceProvider.get(SpriteBatch.class);
gameCamera = new Camera2D(this);
// example of loading a texture into memory:
spriteTex = content.load("", Texture.class);
// ... or with the built-in 'texture' method: content.loadTexture(...)
}
@Override
public void update(DeltaTime delta) {
// game update logic goes here
}
@Override
public void draw(DeltaTime delta) {
// begin the spritebatch phase:
spriteBatch.begin(gameCamera.getViewMatrix(), BlendMode.NORMAL_BLEND);
// sprite draw/put for this drawing phase:
spriteBatch.draw(spriteTex, Vector2.ZERO, Color.WHITE);
// end and draw all sprites stored:
spriteBatch.end();
}
@Override
public void dispose() {
content.dispose();
spriteBatch.dispose();
super.dispose();
}
}
```
> Looking for ECS support? Check [this built-in extension!](https://github.com/joafalves/pixel-community/wiki/E1.-ECS-(Entity-Component-System))
### Project structure ###
The framework functionality is divided into multiple modules which can be imported individually as required.
##### Root directory structure #####
.build/ # Bundle .jar files (run 'bundle' gradle task)
.demos/ # Feature showroom and learning examples
.extensions/ # Extensions for the framework (optional)
├── ext-ecs # Entity component system extension
├── ext-ecs-extra # ECS utility components
├── ext-log4j2 # Log4j2 extension
├── ext-network # Network extension
└── ext-tween # Tween extension
.modules/ # The principal modules of the framework
├── blueprint # Blueprint configuration classes
├── commons # Common utility classes
├── content # Common Content classes (Texture, Font, Audio, ...)
├── core # Core module (GameContainer, GameSettings, Camera2D, ...)
├── graphics # Graphics API module
├── math # Math module (Vector, Matrix, ...)
└── pipeline # Generic Pipeline processing module
.platform/
├── android # Android platform implementation (OpenGL ES)
└── desktop # Desktop platform implementation (LWJGL3)
.resources/
└── images # Project resource images
.build.gradle # Gradle build file
.settings.gradle # Gradle settings file
##### Inner module structure #####
.modules/
└── *module* # Presented file structure similar in all modules
├── build # Module build directory
│ ├── docs # Generated documentation files (run 'javadoc' gradle task)
│ └── libs # Generated .jar files (run 'jar' gradle task)
├── src # Module Source folder
│ ├── main # Module Main Source classes
│ └── test # Module Test Source classes
└── build.gradle # Module Gradle build file (contains inner dependency definitions)
### Runtime requirements ###
- Java 17.x+
### Development requirements ###
- (All Runtime requirements)
- Gradle 8.x+ (gradle wrapper available)
### Runtime OS compatibility ###
For desktop, the same support as the [LWJGL](https://www.lwjgl.org/) dependency, which includes:
- Windows (x86, x64, arm64)
- MacOS (x64, arm64)
- Linux (x86, x64, arm64, arm32)
> Requires OpenGL 3.3+ support.
There is also an Android platform implementation available (OpenGL ES) - **Experimental**.
### FAQ ###
1. I'm unable to run Pixel on MacOS due to system error.
- Add `-XstartOnFirstThread` as a java VM Option before running your project.
2. Is Pixel compatible with Kotlin?
- Yes, Pixel is fully compatible with Kotlin. Check
this [demo](https://github.com/joafalves/pixel-community/tree/devel/demos/kotlin) for an example.
3. Is Pixel available as a Maven dependency?
- Yes, Pixel is available as a public Maven
dependency. [Click here](https://github.com/joafalves/pixel-community/wiki/1.-Getting-Started) for more details on
how to import using Maven or Gradle.
4. Is Pixel free?
- Yes, Pixel is completely free to use and distribute as an application dependency.
### Who do I talk to? ###
* It's a bug or a feature request? [Please open an issue](https://github.com/joafalves/pixel-community/issues).
* Repo owner or moderator.