WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@5gTestSubject
Copy link
Contributor

Adds support for capsule shapes constructed similarly to rectangles and ellipses.

Lots of copy/paste work of ellipse support with a little custom work on drawing.

Object Layer

Screenshot_20251124_031030 Screenshot_20251124_031435-1

A .tmx snippet of an ellipse and a capsule:

<object id="1" x="159" y="71" width="152.615" height="70.5215" rotation="325.864">
 <ellipse/>
</object>
<object id="3" x="383" y="24" width="146" height="70" rotation="18.187">
 <capsule/>
</object>

Tile Collisions

Left: ellipse. Right: two capsules.
They happen to be in an isometric project.
Screenshot_20251124_031632

A .tsx snippet of an ellipse and a capsule:

<object id="1" x="-643.5" y="-442.5" width="110" height="68">
 <ellipse/>
</object>
<object id="2" x="-537" y="-511" width="149.5" height="52.5">
 <capsule/>
</object>

Needs Work

  • Icons: Toolbars are currently using the ellipse icons, though they have the correct tooltips. I don't know how these were created and so can't really make one to match.
  • Translations: idk how y'all do that.
  • Shortcut key: (C was already taken for ellipses 😅)
  • There's an ellipse edge-case that may need to be adapted to capsules. Unclear.
  • Idk the guidelines on who puts what name in a copyright header.

Basically all the easy copy-pastes & switch cases.
Add capsule to shape enums.
Add most switch cases for capsules, often piggybacking on capsule/rect.
Add dock tools (they use ellipse icons currently).
Python/lua bindings.
@5gTestSubject
Copy link
Contributor Author

Oh! Almost forgot. Discussion on feature: #2153

@bjorn
Copy link
Member

bjorn commented Nov 27, 2025

That's great, thanks for making this addition! And indeed this really involved mostly minor adjustments to many places in the code and Qt can already draw these shapes so no problem there either.

I think the only remaining thing we need is a fitting icon. I'll try to create one in the style of the other ones.

I've added your name in copyright line for the new files. I think the changes in other files are small enough that it makes little sense to add your name everywhere. I hope that's fine.

Translations files will be updated 1-2 weeks before I make the next release.

I'm also not sure what would make a good default shortcut...

For the edge case, I've opted to also use it there since a 0-width/height capsule is also just a line. We can test later whether this is still an issue today.

@5gTestSubject
Copy link
Contributor Author

Maybe alt+C would work? There doesn't seem to be an existing expectation of what alt is meant to do and it does make a little sense with how similar ellipses and capsules are.

@bjorn
Copy link
Member

bjorn commented Nov 28, 2025

Unfortunately we already put Alt+C on a hidden "copy hovered coordinates to clipboard" action. :-)

@bjorn
Copy link
Member

bjorn commented Nov 28, 2025

Alright, icons are in, docs are updated, NEWS is updated! I think we're ready to merge this, @5gTestSubject?

@5gTestSubject
Copy link
Contributor Author

@bjorn looks good from my end. Thanks for accepting this! Game devs are gonna be happy.

@bjorn bjorn merged commit 185011f into mapeditor:master Dec 1, 2025
12 of 13 checks passed
@bjorn
Copy link
Member

bjorn commented Dec 1, 2025

@5gTestSubject Thanks again for this contribution! I've opted to put it on Shift+C in the end, which should be still available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants