Setting HUD title bar texture..how??

I want to override the default HUD title bar texture…without…getting into the whole theming thing

There’s Frame constructor with the following signature:


Frame(WidgetContainer, boolean, TitleDescription, String)

You can create a TitleDescription from scratch as follows:


Frame.TitleDescription titleDesc = new Frame.TitleDescription( ... );
titleDesc.setBackground( yourTexture );
titleDesc.set ....
...

or, if you don’t want to set all the properties, just retrieve the template from the current theme and change just the background texture:


Frame.TitleDescription titleDesc = HUD.getTheme().getFrameTitleDescription();
titleDesc.setBackground( yourTexture );

Then just use the full constructor of the Frame class as follows:


Frame myFrame1 = new Frame( new Panel( ... ), true, titleDesc, "myFrameTitle1" ) );
Frame myFrame2 = new Frame( new Panel( ... ), true, titleDesc, "myFrameTitle2" ) );
Frame myFrame3 = new Frame( new Panel( ... ), true, titleDesc, "myFrameTitle3" ) );

Does this solve your problem?

Marvin

I’ve just added convenience constructors to Frame and Dialog, that take a Texture for the title bar.
Additionally there’s a new method in Frame and Dialog, called getTitleWidget(), which returns an the used instance of Frame.FrameTitleWidget, that offers methods to retrieve and modify the title Widget after the frame was created.

But I still think, it is easier to create a custom Frame.TitleDescription to make all Frames look the same, isn’t it?

Marvin

thanx…

You’re welcome :).