Basic Hex Grid For PixiJS. Version 0.30 (alpha).
HexPixiJs is a simple library written to give hex grid based game developers a jump start. This library will be updated periodically but there is currently no roadmap of features. Feel free to request features.
Use /bin/hexpixi.js
file for the browser.
Add this repository to your dependencies, do npm install
and require('hex-pixi-js');
in your code.
This is not supposed to be and end-all solution for making hex grid based games. There is currently no documentation, but the code is fairly simple so I believe there is value for some developers.
I realize there is a CORS (cross origin resource sharing) issue if you are trying to view this without a webserver. In otherwords, if you download the files and double click index.html, the texture might not load.
A brief list and description of the important project files:
- scripts/hexpixi.js -Contains the HexPixiJS library code.
- scripts/hpdemo.js - This javascript code sets up the main demo page and serves as an example of how to use HexPixiJS.
- simpleDemo.html - Demonstrates basic usage of library.
- scripts/simpleDemo.js - Demonstrates basic usage of library.
- simpleDemo2.html - Demonstrates advanced usage of library.
- scripts/simpleDemo2.js - Demonstrates advanced usage of library.
Here is a demo page with a basic map generator on it. Map Generator Demo
Simple demo shows barebones usage. Simple Demo
Simple demo 2 shows interactive map usage. Simple Demo 2
Released under the MIT license.
Art assets for simple demo 2 by Kenney
Feel free to submit contributions.