Best way to add a custom tag to a path

General discussions about Inkscape.
vlad2048
Posts: 5
Joined: Tue Mar 01, 2011 3:03 pm

Best way to add a custom tag to a path

Postby vlad2048 » Wed Mar 02, 2011 6:43 am

Again, I'd like to use Inkscape as a level editor.
I want to be able to draw a simple straight line in Inkscape, tag it as "playerStartingPos" and when I load the .svg in my program, it will convert the line into the starting position.
What is the best way to tag a path in Inkscape ?
Is it by going in the XML Editor, locate the path and click "Add text node" and set it to "playerStartingPos" ? And then detect that node in my loading code

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Best way to add a custom tag to a path

Postby druban » Thu Mar 03, 2011 5:01 am

You could try putting it in a layer (which is really just a user named group), and naming that layer. The path should remain associated and be consistently detectable.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Best way to add a custom tag to a path

Postby ~suv » Thu Mar 03, 2011 6:57 am

You can add a custom label to each object in your document in the dialog 'Object > Object Properties' (the same dialog can also be extended to add Javascript calls)


Return to “General Discussions”