Draw a line with physics properties


(Shahjada Ahmed) #1

Hi. I have a question about drawing line with two points in Tiled map editor 1.2. Is it possible to draw a single line created using two points? I do not want to draw any polygon. I want to draw line and add custom physics property to it. Can this be done? I am not looking for a polygon solution where a very thin polygon can theoretically achieve this.


(Shahjada Ahmed) #2

I guess one solution is to use rectangle with very thin width near 0


#3

There is also a polyline.


(Shahjada Ahmed) #4

I can see there is an option for editing polygons, no UI button for polyline


#5

There is a UI button for it, it looks like and is next to the insert polygon button. Alternative you can press ‘L’.

More info:
http://doc.mapeditor.org/en/stable/manual/objects/#insert-polyline


(Shahjada Ahmed) #6

Image link : https://goo.gl/QwezUJ
Sorry I still do not see this button, are you using Tiled 1.2?
I believe you are using the earlier version of the editor, which had this button as far as I recall


(Shahjada Ahmed) #7

I downloaded 1.2 build from :slight_smile:https://thorbjorn.itch.io/tiled/download/eyJleHBpcmVzIjoxNTQxNzczMTQ0LCJpZCI6Mjg3Njh9.G8OCJ9GLR5o0La3SP3Tn8c4VvWs%3D

  • Reinstalled it and still do not see the polyline button

#8

You are right, I was using Tiled 1.1.5. In the news I found this:
Unified the Create Polygon and Create Polyline tools

Seems like you have to use the polygon tool now. I will install the new Tiled version later to try it out.


(Shahjada Ahmed) #9

The previous polyline feature I am missing :frowning:
Now the whole boundary of a line created is like a rectangular area which collides with other physics objects! Definately a bug!


(Shahjada Ahmed) #10

However I do not know which side the bug is on, whether it is in 1.2 side or it is in Berry Tiled engine, so commenting in this forum too!


(Thorbjørn Lindeijer) #11

The polygon and polyline tools are unified, which means you now use the same tool to make either polygons or polylines. If you only want a polyline, all you need to do is to avoid clicking the initial point again to close the polygon.

To create just a single line, start creating a polygon and then right-click after you’ve placed the second point.


(Shahjada Ahmed) #12

Thanks for the feedback. I could draw polyline with the same tool no issues.