Package com.jme3.font

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


    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

  /** 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

  /** 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

    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

    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

    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

        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

      settings.getHeight() / 2 + ch.getLineHeight() / 2, 0);
    guiNode.attachChild(ch);
  }
    public void initFlash() {
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText ch = new BitmapText(guiFont, false);
    ch.setColor(ColorRGBA.Orange);
    ch.setSize(guiFont.getCharSet().getRenderedSize() * 150);
    ch.setText("+"); // crosshairs
    ch.setLocalTranslation( // center
      settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 180,
      settings.getHeight() / 2 + ch.getLineHeight() / 2+300, 0);
    ch.setName("flash");
    guiNode.attachChild(ch);
  }
View Full Code Here

    guiNode.attachChild(ch);
  }
    public void initDamage() {
            System.out.println("KKKKKKKKKKKKKKKKKKKK");
    guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    BitmapText ch = new BitmapText(guiFont, false);
    ch.setColor(ColorRGBA.Red);
    ch.setSize(guiFont.getCharSet().getRenderedSize() * 150);
    ch.setText("="); // crosshairs
    ch.setLocalTranslation( // center
      settings.getWidth() / 2 - guiFont.getCharSet().getRenderedSize() / 3 * 180,
      settings.getHeight() / 2 + ch.getLineHeight() / 2+300, 0);
    ch.setName("damage");
    guiNode.attachChild(ch);
  }
View Full Code Here

TOP

Related Classes of com.jme3.font.BitmapText

Copyright © 2018 www.massapicom. 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.