Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

26. May 2012, 10:29:30 pm
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)Alpha Textures in HUD
Pages: [1]
Print
Author Topic: Alpha Textures in HUD  (Read 1249 times)
jeepndesert
Becoming dependent
**
Offline Offline

Posts: 103


jeep_in_desert@yahoo.com
View Profile WWW
« on: 28. May 2007, 09:00:22 pm »

It would be nice to be able to construct a new hud widget, pass the actual texture rather than string, and the alpha flag. And also be able to set the alpha flag after it is constructor.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 28. May 2007, 10:22:52 pm »

It would be nice to be able to construct a new hud widget, pass the actual texture rather than string, and the alpha flag. And also be able to set the alpha flag after it is constructor.

This is already possible. A Texture is always passable as a string (name) and the boolean alpha flag or as Texture instance. A Texture is always loaded by TextureLoader with or without alpha channel. The alpha information is stored inside the Texture.

So you could either load a Texture by
Code:
Texture tex = TextureLoader.getInstance().getTexture( "bla.png", Texture.RGBA );
Image img = new Image( 640f, 480f, tex ); // this is a HUD Image Widget (not an AWT Image)
or by
Code:
Image img = new Image( 640f, 480f, "bla.png", true ); // this is a HUD Image Widget (not an AWT Image)
which will produce the exact same result.

Or course the amount of transparency is defined by the Texture itself. Using a user-defined alpha value is is also imaginable, but not (yet) possible.

Marvin
Logged
jeepndesert
Becoming dependent
**
Offline Offline

Posts: 103


jeep_in_desert@yahoo.com
View Profile WWW
« Reply #2 on: 01. June 2007, 12:07:19 pm »

you're right, there are more important things to worry about.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic