https://github.com/jjfiv/gfx
GFX library to simplify Graphics2D access.
https://github.com/jjfiv/gfx
awt awt-graphics gfx gfx-library java midd-cs201 smith-csc212
Last synced: about 1 month ago
JSON representation
GFX library to simplify Graphics2D access.
- Host: GitHub
- URL: https://github.com/jjfiv/gfx
- Owner: jjfiv
- Created: 2018-09-09T14:27:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T14:57:05.000Z (over 2 years ago)
- Last Synced: 2025-01-20T10:44:59.499Z (9 months ago)
- Topics: awt, awt-graphics, gfx, gfx-library, java, midd-cs201, smith-csc212
- Language: Java
- Homepage:
- Size: 49.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GFX [](https://travis-ci.org/jjfiv/GFX) [](https://jitpack.io/#jjfiv/gfx)
GFX library to simplify Graphics2D access to just using inheritance. If you just want to put some graphics on screen and don't want to learn about the Swing threading model, this is your friend.[JavaDoc](https://jitpack.io/com/github/jjfiv/GFX/1.7.0/javadoc/)
## Motivation
Getting a drawable canvas in Swing can require many steps, and event handlers and the EventQueue thread are full of traps for newcomers. This library simplifies all that:
```java
import java.awt.Color;
import java.awt.Graphics2D;import me.jjfoley.gfx.GFX;
public class MyDrawing extends GFX {
// Draw is called 60 times per second.
@Override
public void draw(Graphics2D g) {
g.setColor(Color.red);
g.fillRect(0, 0, 200, 200);
}// Running with graphics is as simple as calling ``start`` on your class.
public static void main(String[] args) {
MyDrawing app = new MyDrawing();
app.start();
}
}
```## Use from Maven
This repository can be used via [jitpack.io](https://jitpack.io). First, add the repository:```xml
jitpack.io
https://jitpack.io
```
Next, add this repo:
```xml
com.github.jjfiv
GFX
1.7.0
```