(9.07) scrollbar buttons size, size of stuff in general.

christianboutin.com

12-09-2009 22:15:06

I'm currently trying to build a skin for my game ( Tales of the USCA, see showcase :-) ). Game has very modest GUI needs (basically, main menu, options menu and so on, game itself has no interactive gui).

Anyway, leaning seriously towards QuickGUI. I was trying to replace the images of qgui with my own, and I ran into an issue with the scrollbar.

The GUI design I made has rectangular arrow buttons for vertical scrollbar (instead of square buttons). But even though my image is a rectangle it shows up as a square. Also, I can't see where the size of the scrollbar (horizontal size for a vertical scrollbar) is set. So if I want to make it bigger, how do I proceed? Change the size of the image has no effect. Are these things hard-coded? Because I haven't found anything about the size of things in the skinTypes file.

If square and scrollbar size are restrictions then no biggie, I'll adjust. But if I can change them I'd like to know how. Thanks!

kungfoomasta

13-09-2009 05:46:52

I checked the source code, and there is a way to configure the ScrollBar 'thickness', but it must be done before creation of the widget, using the desc property. You may or may not know, but any widget that derives from ContainerWidget can have the ability of scrollbars. Since ContainerWidget adds the scrolling functionality, I've created related ContainerWidget properties.

Here is an example of how to change the thickness:

myPanelDesc->containerwidget_scrollBarThickness = 25;
...
myWindow->createPanel(myPanelDesc);


Note that the size of scrollbars seems currently hardcoded to 15 pixels, and I haven't really tested any other values.

About having non-square scroll buttons, thats not currently supported. Is it possible you could post a screenshot to show me what your mockup looks like? Supporting this request would be a ton of work, not sure if its very feasible.

christianboutin.com

13-09-2009 13:43:11

Thanks for the reply! I don't think it's worth changing it. I mean for me it's just 2 minutes in GIMP to do square buttons, and the difference will be hardly noticeable. The buttons were just squeezed a little bit like in the Taharez example of CEGUI. Maybe something to put on your low-priority todo list.

Cheers!

kungfoomasta

13-09-2009 16:20:50

I was thinking, you could actually imitate non-square buttons by doing the following:

(Right side Vertical ScrollBar)
1. Set the thickness of the scrollbars high, like 25 pixels
2. Modify the textures of the vertical scrollbar skin to have a lot of transparency on the left side. On screen the buttons would be 25 x 25 pixels, and your texture could be 25 x 25 pixels, except there is a transparent 10 pixel area on the left side of the texture, meaning the buttons would be drawn as 15 x 25 pixels. You'd also have to take a similar approach to the scrollbar background and slider, and since there is transparency picking, the scrollbar would essentially have rectangular buttons like you wanted.