Phaser UI Tools

screenshot of Phaser UI Tools

UI Kit for the Phaser game engine. Rows, columns, viewports, scrollbars, stuff like that.

Overview:

Phaser UI Tools is a library that provides various tools and components for creating user interfaces in Phaser game development framework. It offers features like text overlays, buttons, containers, viewports with scrollbars, value bars, quantity bars, and a wheel3D component. This library aims to simplify the process of creating interactive and visually appealing UI elements in Phaser games.

Features:

  • Text Overlays: Allows adding text on top of sprites using the setText() method.
  • TextSprite: A sprite that can have text on top. Text is added with the setText() method.
  • TextButton: A button that can have text on top. Text is added with the setText() method.
  • Containers: Provides Phaser Groups where child objects can be arranged as columns or rows.
  • Viewport: Enables creating a scrolling display by combining it with a scrollbar. Can be used to align content easily.
  • Scrollbar: Used to move objects within a viewport. Can be customized with tweening duration and easing.
  • ValueBar: Similar to a scrollbar, but instead of moving content, it increases or decreases a number. Can be customized with tweening duration and easing.
  • QuantityBar: Adjusts its size based on a value. Useful for creating health bars, stamina bars, etc.
  • Wheel3D: A collection of sprites arranged around a three-dimensional wheel. Can be rotated along the x, y, or z axis.

Using NPM:

  1. Open the command line and type the following command:
npm install phaser-ui-tools
  1. The objects from the library are now available for importing in your project. You can use the following code snippet to import them:
import { TextOverlays, TextSprite, TextButton, Containers, Viewport, Scrollbar, ValueBar, QuantityBar, Wheel3D } from 'phaser-ui-tools';

Adding the file directly to your project:

  1. Download phaser-ui-tools.js from the releases section.
  2. Add the downloaded file to your project's index.html file. It should look something like this:
<script src="path/to/phaser-ui-tools.js"></script>
  1. Now, the objects from the library can be used directly in your project.

Summary:

Phaser UI Tools is a useful library for creating UI elements in Phaser games. It offers various components like text overlays, buttons, containers, viewports with scrollbars, value bars, quantity bars, and a wheel3D component. By simplifying the process of creating visually appealing and interactive UI elements, this library can enhance the user experience in Phaser games.

documentation
Documentation

Documentation themes are built specifically for writing technical and product documentation. They are normally written and maintained in Markdown. The often include a navigation menu, search bar, clear headings, semantic document structure and clean typography.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.