some errors about addMaterial

huaner

13-07-2007 08:29:27

hi;
i think every widget can be add ourselves material when created. but, there 3 errors i came across.
1. progressBar, i give it a material, eg Examples/OgreLogo, the error is: can't fint Examples/OgreLogo.bar
2 TrackBar, i give it a material, eg Examples/OgreLogo, the error is: can't fint Examples/OgreLogo.horizontal
3 ComboBox, , i give it a material, eg Examples/OgreLogo, the error is that has a exception
can we give widgets a defined material?
thanks

kungfoomasta

22-08-2007 10:13:58

materials are no longer used with QuickGUI. Instead, you have to specify actual textures, ie "mytexture.png", or "qgui.textbox.png", etc.

I have defined a certain naming scheme for naming textures by default. I believe you can specify any texture you want, but it's a lot easier and more organized if you follow the scheme. For example:

Window:
window.png
window.titlebar.png
window.titlebar.button.png
etc.

Button:
mybutton.png
mybutton.down.png
mybutton.over.png

And the same follows for a lot of other widgets, like combobox, progress bar, and track bar. If you look at the already existing png's, or if you view the code, you will see the standard I have set. If the texture does not exist, the widget will appear transparent. (It won't crash the app)

The alternative would require users to set the texture for each individual part of every widget they create, every time they created it. Not very favorable, IMO. Since I have rules set up, I can use them to apply a default texture to widgets and their child parts. Hope it makes sense. You can still set each texture individually, and if you can't, let me know and I'll add it in.