java - How to draw a hexagon map in libGdx using the Polygon class? -
i asked this question on how draw hexagon in android. after finding in accepted answer have use umpteen lines of [repetitive] code (compared eleven when using regular java graphics
, polygon
objects) began search solutions. found libgdx has polygon
class. began trying implement code in linked question (the code question started out with) slight modification, including replacing graphics class.
i stumbled without checking api , found unlike java polygon
class libgdx polygon
class has 1 constructor. float array hold vertices. unfortunately code did not work after placed float vertices[6]
in constructor. no errors, not desired result.
next began laborious task of searching through api. found several classes suspect can used achieve desired effect (drawing hex map first strategy game). polygon class has several methods suspect can implemented.
i, many other amateur programmers tend learn best example, however. have been able reproduce desired results after studying else's implementation. problem stumping me, can give example of how detailed explanation. have done several google searches try , find example. hexagon math simple enough, drawing hexagons seems task.
(i have added code question had not forgotten dropbox. currently, days, stuck using ipad, not trusty rca android tablet store code on)
edit:
my actual question title. if not possible in straightforward or simple manner please explain why.
if understand question, mixing these links may create want:
1- http://www.alcove-games.com/advanced-tutorials/isometric-tile-picking/
2- http://www.gdreflections.com/2011/02/hexagonal-grid-math.html
3- other link, code repo: http://code.google.com/p/libgdx-tiled/source/browse/#svn%2ftrunk%2flibgdx-tiled-hex-desktop%2fsrc%2fgame%2fhex
http://code.google.com/p/libgdx-tiled/source/browse/releases/gdx-tests/tiledmaptest.java
hope help, not put coments, because there many coments, thinks, if information not valid you, notify me , delete
Comments
Post a Comment