Hello again, I’m starting to feel silly asking all these questions… anyway:
I’m trying to make a scoreboard to my HUD. It’s represented by a Node which has a large quad as a background. To the scoreboard I’m trying to draw entrys made out of this class:
/**
* A scoreboard entry representing a Player.
*/
private class Entry extends Node {
// The name, score and ping info.
private Text[] label;
/**
* Takes a <code>Player</code> and makes a scoreboard representation
* of it.
* @param player The <code>Player</code> to grab all the info from.
*/
Entry(Player player) {
super("Scoreboard Entry");
label = new Text[] {
new Text("name entry", player.node.getName()),
new Text("score entry", ""+player.getScore()),
new Text("ping entry", ""+player.getPing())
};
setRenderState(font);
setRenderState(alpha);
// Loop through the elements to set their translation and color and
// then attach them to this node.
int x = 0;
for (int i = 0; i < label.length; i++) {
label[i].setLocalTranslation(new Vector3f(x, 0, 0));
label[i].setTextColor(Config.getInstance().
scoreboardForegroundColor);
attachChild(label[i]);
x += 250;
}
}
}
As you see the Entry is extending Node and contains a series of Text objects.
The problem is that when I'm trying to move the whole entry by calling Node.setLocalTranslation(Vector3f) the Text objects doesn't seem to be affected...
This is strange, because when trying it with Quads insead of Texts, I get the desired result :?
Any ideas?