Questions tagged [hexagonal-tiles]

Tessellating tiles for use as 2d-histogram bins, game boards, etc.

Hexagonal tiles are tessellating hexagons placed adjacently to each other.

The use of this tag is fairly broad, encompassing statistics, computer science and game design.

234 questions
1
vote
0 answers

Add row to hexagon grid

I am trying to add a few rows to my hexagon grid, the ideal situation would be if the grid looks something like this: https://i.stack.imgur.com/T9Bw1.jpg I know I have to change something in this, but I can't seem to figure out what to do…
Marijn Roukens.com
  • 113
  • 1
  • 1
  • 5
1
vote
1 answer

Storing hexagonal shape grid data into an array

I'm generating hexagonal shape grid as explained in Amit Patel's website redblobgames.com I have tested the grid and everything , including the coordinates is correct. Now I'd like to store the grid data into an array. I partially figured it out,…
Alexus
  • 1,887
  • 1
  • 23
  • 50
1
vote
1 answer

Generating centered hexagonal lattice

I want to create a hexagonal lattice but it should be centered basically the whole lattice is a central hexagon and then layers of hexagon around, like shown in the figure. (may be my description is confusion, but right now that is how I am seeing…
jkhadka
  • 2,443
  • 8
  • 34
  • 56
1
vote
1 answer

Perspective Coords for 2D Hex Grid

Here's a stumper... Porting some old code, I have this 2D hex grid being rendered in 2.5D: The y-scale & position of the tiles is calculated for perspective, but I'd like to scale & position them for perspective horizontally as well (the toons at…
1
vote
2 answers

Drawing Hexagon on Canvas, testing mouseclick event vs Hexagon

Im drawing a hexagon-based grid on the canvas. Each hexagon is an object that holds the 6 points in x/y coordinates. Each hexagon object also holds its X/Y columns/row index. var canvas = document.getElementById("can"); canvas.width = 200; …
user431806
  • 396
  • 5
  • 17
1
vote
3 answers

Generate hexagonal islands

I'd like to generate flat islands existing of multiple hexagons. So far I've been able to create hexagonal meshes with code, but can't figure out how to position them in groups, creating a randomly shaped island. (Any shape that's not a perfect…
1
vote
0 answers

How to make clickable Hexagon tiles in libGDX?

I have a Hexagon tmx map in libGDX. The rendering works just fine, however I am having trouble finding out a way to detect clicks within these tiles.
1
vote
1 answer

Responsive Hexagon grid with a border

http://codepen.io/web-tiki/pen/HhCyd I am working using the above pen from a similar question. I was able to edit the size of the hexagon editing the width property and padding but I wanted to add a border to the hexagon, I was able to the left and…
Sanath Shetty
  • 23
  • 1
  • 3
1
vote
2 answers

How to convert this extensive Python loop to C++?

I know very little on Python, but I'm quite experienced in C++. I was looking for an algorithm that would loop through the points in a hexagon pattern and found one written in Python that seems to be exactly what I need. The problem is that I have…
Corey Iles
  • 155
  • 1
  • 17
1
vote
2 answers

How do I create an iterator from a regular array in Java?

public class TileGrid implements Iterable { private wheelSize = [a positive integer]; private Tile[][] grid = new Tile[wheelSize * 2 + 1][wheelSize * 2 + 1] @Override public Iterator iterator() { return…
Z3wz
  • 61
  • 1
  • 8
1
vote
1 answer

How to add an image into a hexagon in a hexagonal grid?

I have a problem with a hexagonal grid. I found this code you can see below on Internet, so it's not mine. There are two public classes: hexgame which generates the grid and hexmech which draws and fills every single hexagon. What I'd like to do is…
1
vote
1 answer

How to draw a hexagon map in libGdx using the Polygon class?

I recently asked this question on how to draw a hexagon in Android. After finding in the accepted answer that I would have to use umpteen lines of [repetitive] code (compared to the eleven when using regular Java Graphics and Polygon objects) I…
Jax
  • 402
  • 7
  • 24
1
vote
1 answer

How to create programatically Hexagon UIButton or Clickable ImageView with Swift

I want to create programatically Hexagon UIButtons with Swift. I have hexagon images as you can see green picture. The edges are transparent, so you shouldn't click that areas. By using default UIButton with "custom" option, these areas are still…
1
vote
1 answer

NetLogo: World size as a decimal

In NetLogo, I'm trying to create a hexagonal grid where all of the hexagons are equilateral. While the examples in the models library create hexagonal grids, they aren't equilateral, so I can't use the same method that they did. In order to make…
1
vote
0 answers

matplotlib hexbin gap removal

I have three lists of data, of length 35: X, Y and Z. I do plt.hexbin(X, Y, C=Z, gridsize=35) to yield the following plot. How to get rid of the whites?
mikael
  • 2,097
  • 3
  • 18
  • 24