Examples of BitmapText


Examples of com.jme3.font.BitmapText

    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);
   
        tuioStatsText = new BitmapText(guiFont, false);
        tuioStatsText.setLocalTranslation(80, tuioStatsText.getLineHeight()*3, 0);
        tuioStatsText.setText("");
        tuioStatsNode.attachChild(tuioStatsText);
       
        tuioStatsText2 = new BitmapText(guiFont, false);
        tuioStatsText2.setLocalTranslation(80, tuioStatsText2.getLineHeight()*2, 0);
        tuioStatsText2.setText("");
        tuioStatsNode.attachChild(tuioStatsText2);
  }
View Full Code Here

Examples of com.jme3.font.BitmapText

  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    //cam = app.getCamera();
    assetManager = app.getAssetManager();
        guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
        fpsText = new BitmapText(guiFont, false);
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        //camText = new BitmapText(guiFont, false);
        //camText.setLocalTranslation(0, camText.getLineHeight()*5, 0);
        //camText.setText("Cam: ");
View Full Code Here

Examples of com.jme3.font.BitmapText

     * Attaches FPS statistics to guiNode and displays it on the screen.
     *
     */
    public void loadFPSText() {
        guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
        fpsText = new BitmapText(guiFont, false);
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        guiNode.attachChild(fpsText);
    }
View Full Code Here

Examples of com.jme3.font.BitmapText

        } else if (entity instanceof WeaponEntity) {
        }
    }

    private void initCrossHairs() {
        ch = new BitmapText(myApp.getFont(), false);
        ch.setSize(myApp.getFont().getCharSet().getRenderedSize() * 2);
        ch.setText("+");
        ch.setLocalTranslation(
                myApp.getSettings().getWidth() * 0.5f - myApp.getFont().getCharSet().getRenderedSize() / 3 * 2,
                myApp.getSettings().getHeight() * 0.5f + (ch.getLineHeight() / 2), 0);
View Full Code Here

Examples of com.jme3.font.BitmapText

        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);
        sceneNode.attachChild(txt);
       
        return sceneNode;
  }
View Full Code Here

Examples of com.jme3.font.BitmapText

        cam.lookAtDirection(new Vector3f(0, -1.5f, -1).normalizeLocal(), Vector3f.UNIT_Y);
        cam.setFrustumFar(10000f);
    }

    public void loadHintText() {
        hintText = new BitmapText(guiFont, false);
        hintText.setSize(guiFont.getCharSet().getRenderedSize());
        hintText.setLocalTranslation(0, getCamera().getHeight(), 0);
        hintText.setText("Hit T to switch to wireframe,  P to switch to tri-planar texturing");
        guiNode.attachChild(hintText);
    }
View Full Code Here

Examples of com.jme3.font.BitmapText

    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);
        label.setColor(ColorRGBA.White);
        label.addControl(new BillboardControl());
        label.setLocalTranslation(x, y, z);
        return label;
    }
View Full Code Here

Examples of com.jme3.font.BitmapText

    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;
          txt.setBox(new Rectangle(-off, 0f, w, txt.getHeight()));
          txt.setAlignment(Align.Center);
          txt.setQueueBucket(Bucket.Transparent);
          txt.addControl(new BillboardControl());
     
      label = new Node("label");
          if(vis.getWorldBound() instanceof BoundingBox){
            BoundingBox bbox = (BoundingBox)vis.getWorldBound();
            label.setLocalTranslation(0f, bbox.getYExtent()+bbox.getYExtent()+0.5f, 0f);
            logger.finest("Label by BBox "+txt.getText()+" @ "+label.getLocalTranslation());
          }
          else if(vis.getWorldBound() instanceof BoundingSphere){
            BoundingSphere bound = (BoundingSphere)vis.getWorldBound();
            label.setLocalTranslation(0f, bound.getRadius()+bound.getRadius()+0.5f, 0f);
            logger.finest("Label by BSphere "+txt.getText()+" @ "+label.getLocalTranslation());
          }
          else {
            label.setLocalTranslation(0f, 2.5f, 0f);
            logger.finest("Label by Code "+txt.getText()+" @ "+label.getLocalTranslation());
          }
          label.attachChild(txt);
      attachChild(label);
    }
  }
View Full Code Here

Examples of com.jme3.font.BitmapText

  }
 
  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;
        float off = w*0.5f;
        txt.setBox(new Rectangle(-off, 0f, w, txt.getHeight()));
        txt.setAlignment(Align.Center);
        txt.setQueueBucket(Bucket.Transparent);
        txt.addControl(new MessagesBillboardControl(ttl,speed));
   
        Node node = new Node("Message");
        if(label != null){
          node.setLocalTranslation(0f,label.getLocalTranslation().y+0.5f, 0f);
        } else {
View Full Code Here

Examples of com.jme3.font.BitmapText

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

        addControl(this);
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.