项目作者: SgtSwagrid

项目描述 :
A graphics library for 2D Java games.
高级语言: Java
项目地址: git://github.com/SgtSwagrid/swag-ui.git
创建时间: 2019-12-16T11:30:00Z
项目社区:https://github.com/SgtSwagrid/swag-ui

开源协议:GNU General Public License v3.0

下载


SwagUI

A graphics library for 2D Java games using OpenGL/GLFW/LWJGL.

Installation

Simply include ‘SwagUI vX.X.jar’ in your project.

Example usage

Example 1

  1. Scene2D scene = new Scene2D();
  2. InputHandler input = new InputHandler();
  3. Window window = new Window(1280, 960, "Example 1", scene, input);
  4. scene.getRoot().addTile(new Tile(0, 0, 100, 100)
  5. .setDepth(1));
  6. scene.getRoot().addTile(new Tile(50, 50, 100, 100)
  7. .setColour(Colour.LYNX_WHITE)
  8. .setAngle(10));
  9. scene.getRoot().addTile(new Button(input, -250, 250, 200, 50)
  10. .onClick((bx, by) -> System.out.println("Hello, World!")));
  11. window.open();

Example 2

  1. Scene2D scene = new Scene2D();
  2. InputHandler input = new InputHandler();
  3. Window window = new Window(1280, 960, "Example 2", scene, input);
  4. scene.getBackground().addTile(new HorizontalList(
  5. new Tile()
  6. .setColour(Colour.LYNX_WHITE)
  7. .setFill(Fill.FILL_PARENT),
  8. new Tile()
  9. .setColour(Colour.NAVAL)
  10. .setFill(Fill.FILL_PARENT),
  11. new Tile()
  12. .setColour(Colour.ELECTROMAGNETIC)
  13. .setFill(Fill.FILL_PARENT)));
  14. window.open();

Notes

This is by no means a complete UI suite, but rather an ongoing project where I will add new features as I need them.
That being said, should anyone request a new feature, I’d be happy to oblige, provided it isn’t stupid.
(Alternatively, and dare I say even better, you could implement it yourself.)