createNStateButton

huaner

18-09-2007 14:37:03

hi:
i create a NStateButton. but, when the cursor on it ,this widget disppared but it can respond its event. my code is:

QuickGUI::NStateButton *frontTexButton = NULL;
QuickGUI::NStateButton* stateButton = window->createNStateButton(QuickGUI::Rect(x, y, width, height));
stateButton->addState(StaButtonPropoty, StaButtonMatName);
frontTexButton = window->getNStateButton(0);

why it's disappeared? thanks!

kungfoomasta

18-09-2007 16:19:07

If the texture StaButtonMatName cannot be found in Ogre Resource Manager or on disk, the Widget's quad will render invisible. Make sure you are using valid Texture names. Materials are no longer supported.

Also, if the assumed textures are not valid, they will render invisible also. For example, lets say

StaButtonMatName = "huaner.png"

Then, QuickGUI will try to make use of the following textures:

huaner.over.png
huaner.down.png

If they do not exist, they will make the NStateButton invisible. *.over* is applied when mouse is over the button, and *.down* is applied when left mouse button down on button.

huaner

19-09-2007 01:46:04

If the texture StaButtonMatName cannot be found in Ogre Resource Manager or on disk, the Widget's quad will render invisible. Make sure you are using valid Texture names. Materials are no longer supported
thank you for reply. but, i'am sorry that i don't understand clearly. i'am sure i give a texture name to "StaButtonMatName", e.g.next.png. the rendering is all right. just when i click on StateButton, this widget is invisible; but, the event is responded.
so, the trouble is that this widget is visible at first, but invisible when i click it to respond my event.

kungfoomasta

19-09-2007 02:24:39

texture: next.png

When you mouse over, it will try to apply next.over.png
When you mouse button down on it, it will try to apply next.down.png

If you don't have next.down.png, the button will be invisible.