Oversized UI Customization

Godot Version

4.3

Question

Hello, I’m working on customization themes for the generic Godot UI elements. In this specific case a horizontal slider.

I’m trying to get a oversized version and make it thicker using scale, but when I place my UI scene into another layout container (grid, v or h box) the scale goes back to a 1:1 and the properties are locked in the inspector.

I’ve been looking for a way around this. Any ideas? Is there a better way to do oversized UI?

you can manually reapply the scale
connect to the size_changed signal of the container or UI element.
In the signal callback, reapply your desired scale:
func _on_size_changed():
$YourSlider.scale = Vector2(2, 2) # Your scale

1 Like

Thanks I’ll give it a try

It doesn’t quite work out. The scaling is inconsistent. it requires the window to be adjusted. I cant guarantee that the container anchors will adjust to the new scale change. So I think scale is out as a means to create oversized ui.

I’m playing around with the theme now. but this too is very limited. The closest I have got to adjusting scale that will still work with anchors is with a StyleBoxTexture and a MeshTexture resource. But unfortunately the Mesh Texture doesn’t seem to work at all with the slider component.

I think what is left is to build it from scratch. The main reason being is that i want a behavior that I don’t see built into the slider component.

imagine a chain texture and a hook for the grabber, when the user adjusts the slider by grabbing the hook, new chain links will be pulled into view. This is not a feature of the theme system and will require a custom shader. And getting that shader for that specific element in the hslider theme doesnt seem possible.

I ended up writing a custom script extending a slider, using empty themes and icons to hide parts of the standard control, and customized texture boxes over the top with the sizes i wanted. I used generic slider signals to prompt adjustment of texture boxes and shaders to get the secondary desired behavior of the chain being pulled.