Coder Social home page Coder Social logo

kellyrayj / hexagonalui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mpewsey/hexagonalui

0.0 0.0 0.0 6.16 MB

A hexagonal grid layout group for Unity.

Home Page: https://mpewsey.github.io/HexagonalUI

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%

hexagonalui's Introduction

HexagonalUI

Docs

Purpose

Unity currently does not offer a built-in layout group for creating stackings of hexagonal elements, such as those sometimes used for skill grids. This package aims to fill that gap by providing a hexagonal layout group that will page UI elements into a grid.

HexLayoutGroup

Installation

To add the package to a project, in Unity, select Window > Package Manager.

HexagonalUI

Select Add package from git URL... and paste the following URL:

https://github.com/mpewsey/HexagonalUI.git

RECOMMENDED: To lock into a specific version, append #{VERSION_TAG} to the end of the URL. For example:

https://github.com/mpewsey/HexagonalUI.git#v1.3.0

Usage

To use, simply attach the HexLayoutGroup component to a Game Object, as you would with Unity's built-in layout group components. The cell orientation component setting is based on the direction of the hexagonal element's long diagonal. In the image above, the hexagons on the top feature a horizontal cell orientation, whereas the hexagons on the bottom feature a vertical orientation.

Due to the staggering of the hexagonal elements, the default Button component input navigation tends to navigate randomly. Therefore, if buttons will serve as the children of the layout group, it is recommended that the HexButton component, which provides more regular navigation behaviour, be used instead.

Tile Art Creation Guidance

To match the dimensions assigned by the hexagonal layout group, it is recommended that hexagonal tile art have their long diagonals to short diagonals proportioned to 1 : 0.86602540378. For instance, the example tile images in this package are 100 px by 87 px, including the required rounding to the nearest pixel.

hexagonalui's People

Contributors

mpewsey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.