Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 01:39:09 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)TextRectangle Background
Pages: [1]
Print
Author Topic: TextRectangle Background  (Read 466 times)
xithN00b
Just dropped in

Offline Offline

Posts: 22


View Profile
« on: 09. March 2010, 03:15:03 pm »

Hi everybody,

Maybe I'm just blind and can't see the method, but how can I change the background of a TextRectangel from transparent to something different?
I've already tried to use the coleringattribute and the material but nothing worked for me. Is there an easy way (like setColor()), or do I really need to add a second rectangle behind the first one?


greetings,
Andreas

Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #1 on: 10. March 2010, 02:00:10 pm »

Hi,
Maybe I'm just blind and can't see the method, but how can I change the background of a TextRectangel from transparent to something different?
I've already tried to use the coleringattribute and the material but nothing worked for me. Is there an easy way (like setColor()), or do I really need to add a second rectangle behind the first one?

As I can see TextRectangle has setColor method inherited from Quad (and btw it has setTexture method inherited from Rectangle).
Maybe this is what you're looking for ...

see TextRectangle.

Regards
Logged

Anton
xithN00b
Just dropped in

Offline Offline

Posts: 22


View Profile
« Reply #2 on: 10. March 2010, 02:30:54 pm »

Hi,

I've already tried setColor() and nothing happend. Changing the material also didn't yield the desired results.


Thanks for your help
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #3 on: 10. March 2010, 03:38:26 pm »

If you want to change transparency you should use setAlpha
Logged

Anton
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #4 on: 10. March 2010, 07:22:36 pm »

I suggest not to use the TextRectangle anymore. Creating a draw texture (static method on Texture2D) is much better, since you can do everything you can do with a TextRectangle and additionally anything you know from drawing on Graphics2D and a lot more. Just have a look at the appropriate testcases.

Marvin
Logged
xithN00b
Just dropped in

Offline Offline

Posts: 22


View Profile
« Reply #5 on: 11. March 2010, 07:45:07 am »

Thanks Marvin, I'll give it a try.


regards,
Andreas
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic