Widget::setSize and Widget::setPosition

rodrigofarias77

20-08-2007 21:49:32

KungFooMasta, are you planning to implement the Widget::setSize and Widget::setPosition methods for the 0.9.6 release? They are only in the header file.

Regards
Rodrigo

kungfoomasta

20-08-2007 23:01:30

hmm.. I see those functions defined in QuickGUIWidget.cpp. I haven't tested them, but they are defined. You can let me know if they have issues. :wink:

rodrigofarias77

21-08-2007 18:48:42

I am sorry, KungFooMasta... Those methods are really implemented. However, I think I am misunderstanding its usage. I thought the following code (from QuickGUIDemo) would set the size of healButton to 20 x 20 pixels...

QuickGUI::Button* healButton = ninjaWindow->createButton(Ogre::Vector4(0.05,0.69,0.9,0.3));
healButton->getText()->setCaption("Heal");
healButton->setSize(20, 20, QuickGUI::QGUI_GMM_PIXELS);


Besides, when I call setCaption after setSize, it seems the text position is not updated...

Regards
Rodrigo

kungfoomasta

21-08-2007 19:00:55

Ah, you found a bug! I need to update the textBounds and re align the text after sizing. I will fix this.

Thanks for bringing that up.

rodrigofarias77

21-08-2007 19:06:28

With regard to the usage of Widget::setSize, try that code I have posted, please...

Regards
Rodrigo

kungfoomasta

21-08-2007 20:03:30

I have fixed setSize and setPosition functions, and did a very basic test to see it working.