Fading out Text?

no you can't because it is using primitive float that are referenced.

See? You'd expect that to work after working with jME for a while…

where is it using primitive float? or has someone updated the cvs? it is using colorrgba and gettextcolor().a = value works perfectly…

@darkfrog: did you test it?

Oops…you are right, that would work.



The problem I was having had to do with me creating a ColorRGBA object and then saying setTextColor with it.  In the setTextColor method it doesn't keep the ColorRGBA that is passed in, rather it calls set on the ColorRGBA that is already there to just get the primitives.

I see you changed the jme code to store the passed in color.  One thing to keep in mind, especially with color, is that people use the static color values a lot.  Storing the actual color object means it's a lot more likely someone will accidently alter the color value of one of the static colors which can obviously have unintended consequences.  I think we need to revisit this again soon and make a change on how we do sets in the api.

That's a good point, but this is the way it works in Spatials already.  Perhaps instead of of ColorRGBA.blue we should have ColorRGBA.getBlue() that creates a new instance (or perhaps both so for static needs you don't have to create a new instance each time).  Personally, I see big advantages to being able to create one ColorRGBA and then setting it to several things and then modifying it directly.  This makes modifying several things simple as well as not needing several instances of the same ColorRGBA.  It's much more efficient in my opinion but I do agree that it can cause some strange issues.