package org.pollux3d.menu;
import org.pollux3d.core.Pollux;
import com.jme3.asset.AssetManager;
import com.jme3.scene.Node;
import com.jme3.system.AppSettings;
import com.jme3.ui.Picture;
public abstract class InfoBox extends Node {
private Picture bg;
private AssetManager assetManager;
private AppSettings settings;
private float height;
private float width;
private float left;
public InfoBox(String name) {
super(name);
assetManager = Pollux.get().getAssetManager();
settings = Pollux.get().getSettings();
height = settings.getHeight();
width = settings.getHeight()/2;
left = settings.getWidth()-width;
}
public float getHeight() {
return height;
}
public float getWidth() {
return width;
}
public float getLeft() {
return left;
}
protected void drawBg(String pictureName) {
bg = new Picture("HUD Picture");
bg.setImage(assetManager, "Hud/"+pictureName, true);
bg.setHeight(height);
bg.setWidth(width);
bg.setPosition(left, 0);
this.attachChild(bg);
}
}