[GUI] Slider thumb width cant be set greater than 30px?

Hello,

I’m trying to use the slider within the GUI and I’ve run into a couple of issues.

  1. I cant set the thumb width greater than 30px. Here is a playground that shows this issue Babylon.js Playground

  2. Should there be a setter for thumbWidthInPixels for the slider?

  3. When I add padding to a slider it seems to distort it and becomes unusable. Here is a playground that shows this issue https://playground.babylonjs.com/#6IT27W#1

1 & 3 are an issue in my current project, does anyone know how I might fix them or use a workaround?

EDIT: I’ve just realized that point 3 isn’t an issue and I was just using padding for the wrong purpose. I should’ve been using slider.top and not slider.paddingTop.

I just realized that point 3 isn’t a issue and I was just using padding for the wrong purpose. I should’ve been using slider.top and not slider.paddingTop.

Hello,

For 1, the thumb must be a square, so the with/height can’t be bigger than min(slider.width, slider.height). As height = 30px, the thumb can’t be wider/taller than 30px.

For 2, it already exists: just pass your width in pixels, as you do in your PG (sliderLargeThumb.thumbWidth = "60px")

Hi Evgeni_Popov, thanks for taking the time to help me out!

For 1, that makes a lot of sense, thanks.

For 2, there seems to be a setter for “slider.thumbWidth” but no setter for “slider.thumbWidthInPixels”. But yes slider.thumbWidth = “…px” works just as good.