On Mon, Feb 6, 2012 at 20:46, Pito <pito...@gmail.com> wrote:
> I continue to have great success with Tiled. Nice app!
Great to hear! :-)
> I want to represent a standard traveling route as an overlay over my
> map, using objects.
>
> I could individually mark each node as an object, and then manually
> indicate the connections through handcrafted xml. But that's a pain.
>
> Or I could try using a bunch of separate lines indicating each edge
> with the end points being the nodes. But then it takes work to tell
> that edge1 and edge2 share a node.
>
> Or I could try using a polyline or polygon, but then I can't represent
> a general graph.
>
> Is there a better way?
Unfortunately this isn't a use-case that is covered by the
polygon/polyline feature, as you have discovered. General graphs would
need to be stored rather differently since they can't be represented
simply by a list of points, but rather need a list of points + a list
of connections between these points. I have currently no plans for
expanding the polygon/polyline feature to graphs, though it would of
course be possible.
I guess one way of representing graphs is to use filled polygons to
mark all the non-passable areas, so that what remains are the routes
you are looking for, but I'm sure this fits right into that list of
non-perfect solutions you had already.
Another option would be to use the polyline feature and then after
loading the map, process all your polylines to generate the list of
unique points and the connections between them. Extracting your graph,
so to speak. This should work fine especially when using the
snap-to-grid feature to make sure the points of the polyline are
exactly aligned. When you really need freely positioned points, you
could try to add a snap-to-point feature to Tiled, which should be
easy compared to adding full graph editing.
Best regards,
Bjørn
In fact the 'Snap to Grid' toggle in the View menu also works for
nodes on polylines/polygons.
> Which leads me to ask whether you wrote down info about those features
> anywhere because I looked around the wiki and didn't see anything. I
> am sure there may be other features hiding that I don't realize are
> there :)
There is a page about shortcuts on the wiki, but Tiled doesn't have a
completely manual yet (not even much of a start). This is a bit
embarrassing, but I still plan to get around to it at some point...
Best regards,
Bjørn
No problem about not having doc, I know how it goes :)
As far as the grid is concerned is it possible to have a different
grid apply to the objects as does to the tiles? In my case I need a
grid that's 4 times finer for the objects as for the tiles?
Thanks,
Pito
2012/2/6 Thorbjørn Lindeijer <thor...@lindeijer.nl>:
> --
> Tiled Map Editor mailing list
> mape...@googlegroups.com
> http://groups.google.com/group/mapeditor
--
Check out http://www.salas.com and http://www.blogbridge.com/look
Not without patching the code at the moment. This is not so hard as it may seem.
The code that would require modification is here for editing polygons:
https://github.com/bjorn/tiled/blob/master/src/tiled/editpolygontool.cpp#L507
And here for creating polygons:
https://github.com/bjorn/tiled/blob/master/src/tiled/createobjecttool.cpp#L148
https://github.com/bjorn/tiled/blob/master/src/tiled/createobjecttool.cpp#L227
Of course that won't change grid rendering, but changing the simple
rounding to a rounding after multiplying by 4 and then dividing by 4
again would give you the behavior you're looking for.
Best regards,
Bjørn