I was wondering what the easiest way to set the color of a button was. I notice there’s methods to set the color of certain effects that could happen to the button, but I’m wondering if there’s a simple method to set the color of the button itself, perhaps with a simple RGBAColor
This will tint any image you are using, so not sure if it’s exacty what you meant, but here goes …
[java]
ButtonAdapter b = new ButtonAdapter(screen, new Vector2f(40, 30));
b.getElementMaterial().setColor(“Color”, ColorRGBA.Red);
b.setText(“Button”);
[/java]
I was wondering what the easiest way to set the color of a button was. I notice there’s methods to set the color of certain effects that could happen to the button, but I’m wondering if there’s a simple method to set the color of the button itself, perhaps with a simple RGBAColor
Just for the sake of verifying the answer you got from @rockfire. This would be the correct way of doing this.
I just did this. It seems to have worked, but the buttons are very dull. Like there is shadows on the buttons or something. Is there a way to brighten this up.
The only alteration I would make to the above is to clone the color first. If you call mult on ColorRGBA.Red… everytime you reference ColorRGBA.Red from this point on it will be the altered version.
EDIT: ignore… mult… not multLocal… just do what he said
@t0neg0d said:
The only alteration I would make to the above is to clone the color first. If you call mult on ColorRGBA.Red... everytime you reference ColorRGBA.Red from this point on it will be the altered version.
EDIT: ignore… mult… not multLocal… just do what he said
lol yus. i already learnt my lesson with the difference between mult() and multLocal() early in my JME career with a really stupid bug :S
@rockfire said:
lol yus. i already learnt my lesson with the difference between mult() and multLocal() early in my JME career with a really stupid bug :S
I made the mistake of updating Vector3f.ZERO… took me forever to figure out what the hell was going on >.<