1
\$\begingroup\$

Tiled has a feature to insert a point in to an Object layer. But there doesn't seem to be a "PointMapObject" implementation in Libgdx on the doc. currently i am being forced to use a PolylineMap Object with two vertices but all i want is only the x or y of the first vertex.

\$\endgroup\$
  • \$\begingroup\$ Can you clarify a little bit? How are you loading the Tiled file? Do you need a specific format in libgdx or can you use your own classes? \$\endgroup\$ – Jay Jan 19 at 3:31
  • \$\begingroup\$ @jay I am loading the tiled file using libgdx's assetManager by setting its map loader like this <pre>assetManager.setLoader(TiledMap.class,new TmxMapLoader(new InternalFileHandleResolver()));<code> i am not sure what u meant by ur last question but if u meant like writing my own tiledmap loader, i can try but i think it would be too much hussle. \$\endgroup\$ – Yosan Girma Jan 19 at 8:04
  • \$\begingroup\$ Just not sure what you mean when you say you have to use two vertices instead of the first one? \$\endgroup\$ – Jay Jan 19 at 10:03
  • \$\begingroup\$ @Jay tiled doesn't allow you to create a polyline with just one vertex. it must atleast have two vertices. \$\endgroup\$ – Yosan Girma Jan 19 at 14:32
  • \$\begingroup\$ Ah I understand what your problem is now. I'm not familiar with gdx so not sure about a solution. Just had a look at the docs and it might be worth looking at TextureMapObject and TiledMapTileMapObject \$\endgroup\$ – Jay Jan 19 at 22:15
1
\$\begingroup\$

Actually points in LibGDX are treated as RectangleMapObject with height=0.0 and width=0.0.

Below debbuger output of object that is point on the tiled side:

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.