Simple gui toolkit for lwjgl or playn videogames.
Java Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

jnuit

Java Newton User Interface Toolkit is a simple lib to create UI for games.

It use lwjgl rendering and a playn implementation is in development.

demo

Features

  • simple components: button, select, toggle.
  • specialized components for games: control settings, video mode selector, audio volume configurator, texts and voices language selector, dialogues...
  • navigable with only one input device: mouse, keyboard or gamepad.
  • free or table based layout.

Optional features

The lwjgl implementation also comes with a collection of utilities to make 2d game prototyping easy to do:

  • assets management.
  • nanim 2d animations loading.
  • smpjpeg video playback.

Games made with jnuit

Getting started

Use jnuit

For a new game project

Use maven archetype plugin to create a project using jnuit:

mvn archetype:generate -DarchetypeGroupId=im.bci -DarchetypeArtifactId=jnuit-archetype -DarchetypeVersion=LATEST -DgroupId=com.mycompagny -DartifactId=superbaryo2 -Dversion=1.0-SNAPSHOT

This project archetype contains everything you need to do a nice game:

  • a full GUI with every settings players expects: video, audio, inputs, languages, bonus...
  • dependency injection with guice.
  • entity system with artemis.
  • tiled level loading.
  • basic rendering and main character moving in isometric and orthogonal levels.

With an existing lwjgl based project

Add jnuit to your maven dependency list:

<dependency>
    <groupdId>im.bci</groupId>
    <artifactId>jnuit-lwjgl</artifactId>
    <version>${jnuit.version}</version>
</dependency>

Learn API

jnuit is classic GUI API with a simple widget and layout hierarchy. There is only a few concepts:

  • widget: basic GUI element. Every widget has a background, borders and can react to input events.
  • layout: widget made to contains other widget.
  • cursor: a cursor focus the current selected widget. Cursor can be moved using keyboard, mouse or gamepad.
  • input events: moving cursor, ok and cancel.

The best way to learn jnuit API is to look at samples: