PDA

View Full Version : Gui styles



legacy-CyberTao
08-26-2003, 03:20 AM
anybody know how to use the gui styles?
I've made some attempts but nothing works so far:
I've made a subclass of guiStyle (lets call it myGuistyle)
I've set the keyname (I think this is how the style is used by a gui component) and set all the image[] to a custom texture like this:



class myGuiStyle extends guyStyles;

#exec texture import etc...(to import the texture 'toto')

DefaultProperties
{
keyname="tata"
Images(0)=Texture'toto'
Images(1)=Texture'toto'
Images(2)=Texture'toto'
Images(3)=Texture'toto'
Images(4)=Texture'toto'
}

then I created a guibutton in a guiPage like that:

class myGuiPage extends GUIPage;


//(...)snip

DefaultProperties
{

Begin Object Class=GUIButton name=myButton
bNeverFocus=true
bAcceptsInput=false
StyleName="tata"
WinWidth = 1;
Winleft = 0;
WinHeight = 0.8;
WinTop = 0.1;
End Object
Controls(0)=GUIButton'myButton'
}

I think this is all that would be required to change the background textuer of the texture but unfortunately it doesn't work : the button has not texture at all( not even the default blue one).

Anyone having some luck with Guistyles so far?

legacy-segall
08-26-2003, 10:10 AM
Have you added it to the GUIController's list of styles?



class MyGUIController extends GUIController;

defaultproperties
{
StyleNames(29)="MyPackage.MyGUIStyle"
}


and in UT2003.ini, tell it to use MyGUIController instead of the default one.

That should do the trick...

legacy-CyberTao
08-26-2003, 11:54 AM
Wow I didn't even know about this one.
I'll give it a try thanks!

legacy-SoSilencer
08-26-2003, 01:16 PM
You don't need a custom GUI controller. All you have to do is call...

MyController.RegisterStyle(class'mystyleclass');

...in the InitComponent functino of the GUIPage you're working on BEFORE you call Super.InitComponent.

legacy-segall
08-26-2003, 02:40 PM
Nice to know.

legacy-CyberTao
08-26-2003, 04:13 PM
Originally posted by SoSilencer
You don't need a custom GUI controller. All you have to do is call...

MyController.RegisterStyle(class'mystyleclass');

...in the InitComponent functino of the GUIPage you're working on BEFORE you call Super.InitComponent.

AWESOME! it works!
Thanks a bunch guys :D
http://instagiber.net/smiliesdotcom/contrib/corky/corkysm60.gif