GUI Workflow? No margin, padding etc?

Hi!
I’ve been working with Defold for a short time now but I have some major pain points when working with GUI design. The first is that there just is no margin or padding for elements in the gui, so it’s really uninspiring to have to place everything by hand, and I don’t even have any sort of grid snapping for that either. This issue is worsened when I want to have a 9-sliced gui element that changes size dynamically based on the content, because now the positions of buttons and other elements have to be recalculated programmatically which isn’t very friendly. The anchor points don’t seem to respect the parents either, which would be at least a partial solution to resizing 9-slices. Setting a gui node to stretch also disobeys the 9-slice so you end up with a stretched sprite and defeating the entire purpose of 9-slicing.

What am I doing wrong?

I have some samples I’ll share with you but first I will ask that you upload a minimal sample project of what you are wanting to do and where it is going wrong. There may be better ways than what you are trying to do. It’s easier to see as an example project than words alone. If we know what you want to be able to do clearly we can suggest design patterns that have worked for us in projects we have released.

For example, your dynamically resized 9patch UI, what’s the use case here? I never use scale to adjust the size of my 9patch GUI elements, always resize the GUI nodes.

so it’s really uninspiring to have to place everything by hand, and I don’t even have any sort of grid snapping for that either.

What kind of UI are you building in this case?

@dapetcu21 has lots of experience with GUI and has probably overcome any issues you have had as well. @connor.halford also has made very complex GUI setups before.

3 Likes

I’m not a good person to ping for support as I use Defold only very sporadically and don’t actually use most systems or use them in unusual ways. For example I don’t use the GUI system at all so can’t help here, my UI is all manually/automatically placed sprites and blocks of color.

3 Likes

Ah, that’s right. I just remembered you had a really impressive setup.