Defold Polygon Editor

And this is my exporter for PhysicsEditor for Defold:

{% for body in bodies %}{% for fixture in body.fixtures %}{% for polygon in fixture.polygons %}shape_type: TYPE_HULL{% for point in polygon %}{% if not forloop.first %}{% endif %}
data: {{point.x}}
data: {{point.y}}
data: 0{% endfor %}

{% endfor %}{% endfor %}{% endfor %}
6 Likes

Wow, this is fantastic! Great job! :star_struck:

That’s magic @COCO! Just cut 50% off the workflow. If it could output separate files, it would be automatic… but that’s not possible, right?

EDIT: Not so fast! This is what the script outputs now (the inverse y coordinates), and a missing polygon:

40

1 Like

In fact I haven’t test it yet, maybe tomorrow, I will update it with a file splitter.

2 Likes

:star_struck::star_struck::star_struck:

Amazing!

6 Likes

That looks great! Is that a Windows .exe doing the splitting?

1 Like

Yes, It’s a Defold project So it should be cross-platformed.
When It’s ready I will open the source on github.

4 Likes

Wow, really cool!

1 Like

I don’t have time to finish it, but here:


It is the tool set showed in the video.

6 Likes

Defpolys – ploys file cutter for PhysicsEditor & gameobject creator
A little update.




  1. copy the defold exporter to PhysicsEditor
  2. export your ploys from PhysicsEditor
  3. cut the file by defpolys
  4. your go files are ready to use

Thank you all my friends!
Defpolys.zip (6.9 MB)

14 Likes

Great work!

1 Like

Actually, It’s my first project made by Defold.
Actually, I’m an Anxiety patient. My brain hurts everyday and thinking about death and madness all the time…
BUT I love computer I love programing I love Defold I love my life and I love all you guys.
Man I Really miss my old day working on computers and working great so everyone takes proud in me.
Lord please tell me what to do.

4 Likes

I’m glad you like my tools. I don’t know why I input this sad post above, but please you don’t have to like it, I don’t like it.

3 Likes

I hope you feel inspired to contribute more, you are clearly skilled. We all appreciate you! :slight_smile:

8 Likes

Hey all,
Someone bugged me on Github a few days ago, so I took a bit and fixed some issues with the polygon editor. To be honest I’m not sure how it ever worked! It’s amazing what I didn’t know when I originally made this.

  • Fixed it constantly having errors when you created vertices…
  • Fixed concave vertices not getting set back to white when they cease to be concave.
  • Hacked in native file dialogs on Linux using Zenity, so it can be usable on Linux.
    • It works on my machine: Linux Mint 20.1, with Zenity installed, but no guarantees that it works for everyone.
    • Added a fallback so you can still save polygons into the application folder on Linux if Zenity doesn’t work.
  • Made the message alerts actually last long enough to read them. :slight_smile:
  • Added a readme with a screenshot to the github repo.
15 Likes

Thank you for the great update! I created a feature request for an HTML5 version and I’ll try to contribute with a PR this week.

4 Likes

@britzl Awesome, thanks! I will look forward to that.

I made a couple other little tweaks today, made the snap increment adjustable, etc.

While my enthusiasm for this is active, are there any other feature requests or bug fixes that I should look at? Anything that would change the editor from Pointless --> Useful?

I submitted a PR for saving from HTML5 a few minutes ago.

I think it is useful as it is!

2 Likes

Ah! Nice, I’ll take a look.

[Edit] Awesome. Merged. Thanks!

1 Like