Image setSize limitation?

wilsonwing

09-06-2009 08:34:11

Hi, me again :lol:
I am still using QuickGUI 9.02
I found that the setSize function for Image(not sure if for other object has the same problem) can't set value smaller than 4.
If I do this:
QuickGUI::Size newSize = QuickGUI::Size(0 , 12);
m_pImageHealthBar->setSize( newSize );

The image is still 4 unit long.
I tried also other value(0 1 2 3 4....), only when the value > 4 it shows the correct size.
Is there any limitation or is this a bug?

kungfoomasta

09-06-2009 08:45:42

By default widgets have a minimum size of (5,5). If you want it smaller you'll need to change the minimum size.


/**
* Sets the minimum size this widget can be.
*/
void setMinSize(const Size& s);


You can also set it in the desc, by setting the widget_minSize member variable.

You should also consider moving to the latest version. :)

wilsonwing

09-06-2009 08:50:14

By default widgets have a minimum size of (5,5). If you want it smaller you'll need to change the minimum size.


/**
* Sets the minimum size this widget can be.
*/
void setMinSize(const Size& s);


You can also set it in the desc, by setting the widget_minSize member variable.

You should also consider moving to the latest version. :)

Thanks :D
I actually thinking of using the newest version, but I am not yet at the phase to finish my game UI.
At that time I will use the latest version, definitely!