SpriteKit Hex Tile Radius. Possible?

I'm trying to make a tiled based game for iOS. I'm using hex tiles for my map via a SKTileMapNode. I'm trying to make it so when the player selects a tile on the map, it finds the hexes surrounding that selected tile within a given range. For example if the range was 2, all tiles within a 2 tile range would be highlighted. I was able to find an algorithm from http://www.redblobgames.com/grids/hexagons/#range-coordinate however, I was unsuccessful in implementing it due to the fact that SKTileMapNode doesn't use a z coordinate ( or at least one easily discoverable). I know how to highlight the tiles once they are determined, the problem is just determining them. Does anyone have any experience in implementing something like this or this very thing using. SKTileMapNode? I'm trying to stay within the Apple ecosystem, but if needed I can use some other tile engine (links provided if suggested please).

Replies

SKTileMapNode uses what the article calls "Offset" coordinates. (see the beginning of the article). So to use any of the algorithms from the article you first need to translate from offset coordinates to the "Cube" coordinate sytem used there. Then translate back to offset coordinates. The algorithms for translating are also included in that article.