“Edit Collision Masks” for Button (panel sprite) object

Adding an “Edit Collision Masks” option for Button (panel sprite) objects would be very nice. This feature would be particularly helpful for buttons that are not rectangular, such as round buttons, especially when they are positioned closely together.
just like the buttons on PlayStation controller etc.

Screenshot 2024-07-29 111538

1 Like

Button objects are custom objects or prefabs. They’re made of other objects. Panel sprites don’t have a mask but if the button object used basic sprite objects then masks could used.

There are several button extensions that add the button feature to sprites but I agree, it would be nice to have both panel sprite and regular sprite buttons. There is less setup involved.

2 Likes

In the joystick setting there is option to edit not just the image but also collision mask.
So I thought it would be nice for the button to have it.

2 Likes

I see the benifits. It’s nice to have 1 package that contains everything with an easy way to add images.

Buttons use the panel sprites so they can be resized. The center parts of the image are repeated instead of being stretched. You can’t stretch an oval but you can move the corners and repeat the straight parts.

https://wiki.gdevelop.io/gdevelop5/objects/panel_sprite/

Again, it would we nice for round buttons and tight spaces. The buttons could use sprites or maybe a separate object that works as a hitbox. Unless the mask resized with the image, a mask for a panel sprite wouldn’t automatically resize.

I’m not saying it shouldn’t be done. I’m all for more options. I’m just saying it could be difficult.

1 Like

The cursor interacts with the children as if they where separate objects, as long as the actions are.inside the prefab or behaviour in the children.

But I don’t really understand this request, the collision masks of the children can be edited just like with normal sprites inside.the object editor on the scene (it would be better if it could be edited in the prefab editor, but as we saw yesterday, it seems they are already working on that one).