# How to extract a point in LibGdx from Tiled map?

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.

• 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? – Jay Jan 19 '19 at 3:31
• @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. – Yosan Girma Jan 19 '19 at 8:04
• Just not sure what you mean when you say you have to use two vertices instead of the first one? – Jay Jan 19 '19 at 10:03
• @Jay tiled doesn't allow you to create a polyline with just one vertex. it must atleast have two vertices. – Yosan Girma Jan 19 '19 at 14:32
• 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 – Jay Jan 19 '19 at 22:15

## 1 Answer

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: