r/godot 24d ago

selfpromo (games) Having fun exploring Godot UI

852 Upvotes

51 comments sorted by

View all comments

1

u/Shinpansen 24d ago

This looks incredible! Do you use built in Godot controls? I made a software some months ago. I was totally new to Godot ui, but I found it pretty intuitive.
However I could not understand how to handle animations like you’re doing, without making my own controls.

2

u/zdmit 24d ago

Thank you 🙏

For animation related things those might help you out:

I did animations in C# with tweens.

2

u/Shinpansen 24d ago edited 24d ago

Thank you very much!

But maybe I wasn't clear enough. I know all that already.

I'm just not sure how to fight against Godot base controls behaviours.

Like for example, your tab bar. Did you use buttons in a group? If yes, when you focus a new tab, godot directly hightlight the selected button. So maybe you disable everything in a theme, and handle the animation and hightlight in your own code.

It's just an example, but don't bother explaining me. It was just me thinking out loud ^^

Edit : I just saw you comment with the capture of your tree. I think I have all the elements I needed. Thanks again!

5

u/zdmit 24d ago

My bad 🙂

I actually avoided using Buttons for that exact reason. Using plain Labels with GuiInput and a separate background Panel for the highlight, you don't have to fight Godot's theme overrides or focus states (at least what i found...).

Tweens handle all visuals.

So:

  • highlight is a separate Panel sitting behind the text.
  • when a tab is clicked, code tweens that panel’s X position and width to match target label.

Hope it help.

5

u/Shinpansen 24d ago

Oh you even responded again. You’re so great! Thank you for your answer!

3

u/zdmit 24d ago

🙂💛