Vertex Helper


For the Ranch in MyDinos, I built a system to support tapping a building to select it. However, the buildings are laid out on an isometric grid, so their outlines are overlapping complex polygons. I used the built-in hit testing in iOS to do this, but we needed to bind a shape to each building.

I looked around for an easy way to do this, and in my search I found this nifty little toy, Vertex Helper by Johannes Fahrenkrug. However, it only solved half my problem. It let you draw a polygon around an image, but its output wasn't exactly flexible. Luckily, it is a public project on GitHub. So I just pulled down the code, and added the output options I needed.

Now, I have a new version that lets you save a complex polygon as a .plist file. This let me just drop the .plists into MyDinos, read them out and then use them as the hit-test for the buildings. This turned the exhaustive proecss of building the "bounds files" for a hundred different