Examples of BitmapFont


Examples of com.golden.gamedev.object.font.BitmapFont

   */
  public GameFont getFont(BufferedImage[] bitmap) {
    GameFont font = (GameFont) this.fontBank.get(bitmap);
   
    if (font == null) {
      font = new BitmapFont(bitmap);
      this.fontBank.put(bitmap, font);
    }
   
    return font;
  }
View Full Code Here

Examples of com.jme3.font.BitmapFont

  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    tuioInput = TuioInput.get();
    tuioInput.addListener(this);
    BitmapFont guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
   
    BitmapText tuioStatsLabel = new BitmapText(guiFont, false);
        tuioStatsLabel.setLocalTranslation(0, tuioStatsLabel.getLineHeight()*3, 0);
        tuioStatsLabel.setText("Tuio Input:");
        tuioStatsNode.attachChild(tuioStatsLabel);
View Full Code Here

Examples of com.jme3.font.BitmapFont

        logo_mat.setTexture("ColorMap", logo_tex);
        logo.setMaterial(logo_mat);
        sceneNode.attachChild(logo);
       
       
        BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt");
        BitmapText txt = new BitmapText(fnt, false);
        txt.setBox(new Rectangle(-2, -2.5f, 6, 3));
        txt.setQueueBucket(Bucket.Transparent);
        txt.setSize( 0.5f );
        txt.setText(txtB);
View Full Code Here

Examples of com.jme3.font.BitmapFont

    b.setLineWidth(size);
    return new Geometry("",b);
  }
 
    public static Spatial getText(AssetManager assetMan, String t, float x, float y, float z, float size){
        BitmapFont fnt = assetMan.loadFont("Interface/Fonts/Default.fnt");
        BitmapText label = new BitmapText(fnt, false);
        label.setBox(new Rectangle(0, 0, 12, 8));
        label.setQueueBucket(Bucket.Transparent);
        label.setSize( size );
        label.setText(t);
View Full Code Here

Examples of com.jme3.font.BitmapFont

    //here z is your up vector and not y
    if (vis != null && charSelection != null && charSelection.name != null) {
      if(label != null)
        detachChild(label);

          BitmapFont fnt = Singleton.get().getAssetManager().getJmeAssetMan().loadFont("Interface/Fonts/Default.fnt");
          BitmapText txt = new BitmapText(fnt, false);
          txt.setSize( 0.4f );
          txt.setText(charSelection.name);
          float w = txt.getLineWidth()+20f;
          float off = w*0.5f;
 
View Full Code Here

Examples of com.jme3.font.BitmapFont

    }
  }
 
  public void addMessageLabel(String msg, ColorRGBA color, float ttl, float speed){
   
        BitmapFont fnt = Singleton.get().getAssetManager().getJmeAssetMan().loadFont("Interface/Fonts/Default.fnt");
        BitmapText txt = new BitmapText(fnt, false);
        txt.setSize( 0.4f );
        txt.setText(msg);
        txt.setColor(color);
        float w = txt.getLineWidth()+20f;
View Full Code Here

Examples of com.jme3.font.BitmapFont

        statLabels = statistics.getLabels();
        statData = new int[statLabels.length];
        labels = new BitmapText[statLabels.length];

        BitmapFont font = manager.loadFont("Interface/Fonts/Console.fnt");
        for (int i = 0; i < labels.length; i++){
            labels[i] = new BitmapText(font);
            labels[i].setLocalTranslation(0, labels[i].getLineHeight() * (i+1), 0);
            attachChild(labels[i]);
        }
View Full Code Here

Examples of com.jme3.font.BitmapFont

    private BitmapFont load(AssetManager assetManager, String folder, InputStream in) throws IOException{
        MaterialDef spriteMat =
                (MaterialDef) assetManager.loadAsset(new AssetKey("Common/MatDefs/Misc/Unshaded.j3md"));
        BitmapCharacterSet charSet = new BitmapCharacterSet();
        Material[] matPages = null;
        BitmapFont font = new BitmapFont();

        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String regex = "[\\s=]+";     
        font.setCharSet(charSet);
        String line;
        while ((line = reader.readLine())!=null){                       
            String[] tokens = line.split(regex);
            if (tokens[0].equals("info")){
                // Get rendered size
                for (int i = 1; i < tokens.length; i++){
                    if (tokens[i].equals("size")){
                        charSet.setRenderedSize(Integer.parseInt(tokens[i + 1]));
                    }
                }
            }else if (tokens[0].equals("common")){
                // Fill out BitmapCharacterSet fields
                for (int i = 1; i < tokens.length; i++){
                    String token = tokens[i];
                    if (token.equals("lineHeight")){
                        charSet.setLineHeight(Integer.parseInt(tokens[i + 1]));
                    }else if (token.equals("base")){
                        charSet.setBase(Integer.parseInt(tokens[i + 1]));
                    }else if (token.equals("scaleW")){
                        charSet.setWidth(Integer.parseInt(tokens[i + 1]));
                    }else if (token.equals("scaleH")){
                        charSet.setHeight(Integer.parseInt(tokens[i + 1]));
                    }else if (token.equals("pages")){
                        // number of texture pages
                        matPages = new Material[Integer.parseInt(tokens[i + 1])];
                        font.setPages(matPages);
                    }
                }
            }else if (tokens[0].equals("page")){
                int index = -1;
                Texture tex = null;
View Full Code Here

Examples of com.jme3.font.BitmapFont

   
    public Object load(AssetInfo info) throws IOException {
        InputStream in = null;
        try {
            in = info.openStream();
            BitmapFont font = load(info.getManager(), info.getKey().getFolder(), in);
            return font;
        } finally {
            if (in != null){
                in.close();
            }
View Full Code Here

Examples of com.jme3.font.BitmapFont

    // Create robotic Arm
    constructArm();

    // Load the HUD
    BitmapFont guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    hudText = new BitmapText(guiFont, false);
    hudText.setSize(24);
    hudText.setColor(ColorRGBA.White); // font color
    hudText.setLocalTranslation(10, hudText.getLineHeight(), 0);
    hudText.setText(getHUDText());
View Full Code Here
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.