Examples of BitmapText


Examples of com.jme3.font.BitmapText

     *  is because several applications expect to directly access
     *  fpsText... unfortunately.
     */
    void setFont( BitmapFont guiFont ) {
        this.guiFont = guiFont;
        this.fpsText = new BitmapText(guiFont, false);
    }
View Full Code Here

Examples of com.jme3.font.BitmapText

     * Attaches FPS statistics to guiNode and displays it on the screen.
     *
     */
    public void loadFpsText() {
        if (fpsText == null) {
            fpsText = new BitmapText(guiFont, false);
        }
       
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        fpsText.setCullHint(showFps ? CullHint.Never : CullHint.Always);
View Full Code Here

Examples of com.jme3.font.BitmapText

    // 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());
    localGuiNode.attachChild(hudText);
View Full Code Here

Examples of com.jme3.font.BitmapText

    viewPort.setBackgroundColor(backgroundColor);

    // 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, app.getContext().getSettings().getHeight(), 0);
    hudText.setText(getHUDText());
    localGuiNode.attachChild(hudText);
View Full Code Here

Examples of com.jme3.font.BitmapText

  /** A plus sign used as crosshairs to help the player with aiming. */
  protected void initCrossHairs() {

    guiNode.detachAllChildren();
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText ch = new BitmapText(guiFont, false);
    ch.setSize(guiFont.getCharSet().getRenderedSize() * 2);
    ch.setText("+"); // fake crosshairs :)
    ch.setLocalTranslation( // center
        settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2, settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
    guiNode.attachChild(ch);
  }
View Full Code Here

Examples of com.jme3.font.BitmapText

  /** A centred plus sign to help the player aim. */
  protected void initCrossHairs() {

    guiNode.detachAllChildren();
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText ch = new BitmapText(guiFont, false);
    ch.setSize(guiFont.getCharSet().getRenderedSize() * 2);
    ch.setText("+"); // crosshairs
    ch.setLocalTranslation( // center
        settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2, settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
    guiNode.attachChild(ch);
  }
View Full Code Here

Examples of com.jme3.font.BitmapText

    rootNode.attachChild(wall);

    // Display a line of text with a default font
    guiNode.detachAllChildren();
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText helloText = new BitmapText(guiFont, false);
    helloText.setSize(guiFont.getCharSet().getRenderedSize());
    helloText.setText("Hello World");
    helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
    guiNode.attachChild(helloText);

    // Load a model from test_data (OgreXML + material + texture)
    Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
    ninja.scale(0.05f, 0.05f, 0.05f);
View Full Code Here

Examples of com.jme3.font.BitmapText

    left = createLine(tl, bl, true);
    right = createLine(tr, br, true);
    bottom = createLine(br, bl, true);

    BitmapFont myFont = GlobalObjectStore.<AssetManager>getObject(AssetManager.class).loadFont("Interface/Fonts/Console.fnt");
    t = new BitmapText(myFont, false);
    t.setColor(ColorRGBA.Pink);
    t.setBox(new Rectangle(0, 0, 100, 100));
    t.setAlignment(Align.Left);
    t.setVerticalAlignment(VAlign.Top);
    t.setLocalTranslation(0, 0, 2);
View Full Code Here

Examples of com.jme3.font.BitmapText

    setupKeys();

    // add ourselves as collision listener
    bulletAppState.getPhysicsSpace().addCollisionListener(this);

    hudText = new BitmapText(guiFont, false);
    hudText.setSize(24); // font size
    hudText.setColor(ColorRGBA.White); // font color
    hudText.setText("D="); // the text
    hudText.setLocalTranslation(10, settings.getHeight() - 10, 0); // position
    guiNode.attachChild(hudText);
View Full Code Here

Examples of com.jme3.font.BitmapText

        inputManager.addListener(i, "Shoot");
    }
    public void updateCrossHairs() {
    guiNode.detachAllChildren();
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText ch = new BitmapText(guiFont, false);
    ch.setSize(guiFont.getCharSet().getRenderedSize() * 4);
        ch.setText("+");
    if(hitmarker)
    {
        ch.setSize(guiFont.getCharSet().getRenderedSize() * 4);
        ch.setText("X");
    }
         // crosshairs
    ch.setLocalTranslation( // center
      settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 2,
      settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
    guiNode.attachChild(ch);
  }
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.