Package org.pollux3d.menu

Source Code of org.pollux3d.menu.InfoBox

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);
  }

}
TOP

Related Classes of org.pollux3d.menu.InfoBox

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.