Update README

This commit is contained in:
octacian 2017-03-14 18:04:07 -07:00
parent 233237a040
commit 1c90af24e3
2 changed files with 45 additions and 20 deletions

View File

@ -3,16 +3,51 @@
HUD Library [hudlib] HUD Library [hudlib]
==================== ====================
This mod aims to create a better player HUD at the same time providing an extensive yet simplified API for modders (see API.md). Though this mod is small at the time, it can be expected to grow with new features including (but not limited to) hunger and armor statbars. * Version: 0.1, beta
* License: MIT (see [LICENSE](https://github.com/octacian/hudlib/blob/master/LICENSE))
HUDLib aims to create a very simple and easy to use API in front of a powerful and complex backend. Sure, there are other mods that introduce APIs to simplify HUD development, but they all focus on some type of statbar (used for things like health) and don't support other HUD elements. However, HUDLib will support all available HUD elements (including statbars and waypoints), wrapping them in an API built to lessen the amount of code you need to make your HUD not only look nice but also be functional.
### Why HUDLib?
When stacked up against other HUD libraries, HUDLib excels in that it supports all HUD elements and has an intuitive API allowing you to do more with less code (see features for more information). However, how does it stack up compared to the default Minetest HUD API?
- HUDs are identified by a name chosen by the modder rather than by arbitrary IDs
- HUDLib supports hiding/showing HUDs without entirely removing them add having to redefine them manually
- HUDs can be registered that will be shown to all players
- HUDs can be removed from all players with one line of code
- All of the HUDs attached to a specific player can be retrieved, including specifics about each HUD (e.g. original definition table, visibility, etc...)
- Callbacks can be added to the HUD definition to be automatically called (e.g. on_step, on_hide, etc...) not unlike those supported within node definitions
- HUDs can be automatically hidden by defining `hide_after` in the HUD definition
- ...and more!
### Features ### Features
- Item description and itemstring is displayed when selected in hotbar - `hudlib.after` which uses a named queueing system replaces `minetest.after`
- Displays tool information in bottom-left when selected in hotbar - HUDs are referenced by a name chosen by the modder
- Hiding/Showing HUDs without having to redefine the HUD
- Showing an HUD to all players
- Removing an HUD from all players
- Auto-hiding HUDs
- Callbacks in HUD definition
- on_step
- on_show
- on_hide
### Planned ### Planned
- Hunger Statbar - List all HUDs attached to a player
- Armor Statbar
- Clock to display time
- API to allow easy registration of features that can be changed per-player, per-HUD with a single chatcommand
- API to register HUDs displayed to all players
- Statbar API - Statbar API
- Waypoint API
- Custom APIs for each element type
- Parent-Child Constraints (e.g. the child's position is made relative to the parent's)
- Auto-repositioning of HUDs to avoid overlap (?)
### API
For information on the API available for use by other mods (this is the API used by HUD Plus), see [API.md](https://github.com/octacian/hudlib/blob/master/API.md).
### Download
[Master](https://github.com/octacian/hudlib/archive/master.zip) (latest, often unstable)<br>
[Version 0.1](https://github.com/octacian/hudlib/archive/v0.1.zip) (latest, stable)<br>
...or View all releases on [GitHub](https://github.com/octacian/hudlib/releases)
__Note:__ HUDLib does not register any HUDs, but only provides an API. If you'd like to see how HUDLib can be used, see [HUD Plus](https://forum.minetest.net/viewtopic.php?f=9&t=16864), the mod in which this API was originally developed.
Choose one of the downloads above and extract the ZIP. Though it is recommended, you are not required to rename the resulting directory to `hudlib`. If you are not sure what to choose, look for the first version labeled as "latest, stable."

View File

@ -1,15 +1,5 @@
This mod aims to create a better player HUD at the same time providing an extensive yet simplified API for modders (see API.md). Though this mod is small at the time, it can be expected to grow with new features including (but not limited to) hunger and armor statbars. HUDLib aims to create a very simple and easy to use API in front of a powerful and complex backend. Sure, there are other mods that introduce APIs to simplify HUD development, but they all focus on some type of statbar (used for things like health) and don't support other HUD elements. However, HUDLib will support all available HUD elements (including statbars and waypoints), wrapping them in an API built to lessen the amount of code you need to make your HUD not only look nice but also be functional.
Features For more information on this mod, see README.md or visit one of the links below.
- Item description and itemstring is displayed when selected in hotbar
- Displays tool information in bottom-left when selected in hotbar
Planned
- Hunger Statbar
- Armor Statbar
- Clock to display time
- API to allow easy registration of features that can be changed per-player, per-HUD with a single chatcommand
- API to register HUDs displayed to all players
- Statbar API
GitHub: https://github.com/octacian/hudlib GitHub: https://github.com/octacian/hudlib