method: render(RenderManager rm, ColorRGBA color) So that it doesn't clobber other BitmapText that just happens to be using the font. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9769 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@ -33,6 +33,7 @@ package com.jme3.font;
import com.jme3.font.BitmapFont.Align;
import com.jme3.font.BitmapFont.VAlign;
import com.jme3.material.MatParam;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.RenderManager;
@ -387,12 +388,28 @@ public class BitmapText extends Node {
needRefresh = false;
}
private ColorRGBA getColor( Material mat, String name ) {
MatParam mp = mat.getParam(name);
if( mp == null ) {
return null;
return (ColorRGBA)mp.getValue();
public void render(RenderManager rm, ColorRGBA color) {
for (BitmapTextPage page : textPages) {
Material mat = page.getMaterial();
mat.setTexture("ColorMap", page.getTexture());
ColorRGBA original = getColor(mat, "Color");
mat.setColor("Color", color);
mat.render(page, rm);
if( original == null ) {
mat.clearParam("Color");
} else {
mat.setColor("Color", original);