/** * Creates the font that will be set to the guiFont field * and subsequently set as the font for the stats text. */ protected BitmapFont loadGuiFont() { return assetManager.loadFont("Interface/Fonts/Default.fnt"); }
/** * Initialize the font. * @param name font filename */ public RenderFontJme(String name, NiftyJmeDisplay display) { this.display = display; font = display.getAssetManager().loadFont(name); text = new BitmapText(font); actualSize = font.getPreferredSize(); text.setSize(actualSize); }
/** * Initializes game */ @Override public void simpleInitApp() { Logger.getLogger("com.jme3").setLevel(Level.WARNING); flyCam.setEnabled(false); setDisplayStatView(false); Keys(); defaultFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); pressStart = new BitmapText(defaultFont, false); fpsScoreText = new BitmapText(defaultFont, false); loadText(fpsScoreText, "Current Score: 0", defaultFont, 0, 2, 0); loadText(pressStart, "PRESS ENTER", defaultFont, 0, 5, 0); player = createPlayer(); rootNode.attachChild(player); cubeField = new ArrayList<Geometry>(); obstacleColors = new ArrayList<ColorRGBA>(); gameReset(); } /**
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.app = app; if (app instanceof SimpleApplication) { SimpleApplication simpleApp = (SimpleApplication)app; if (guiNode == null) { guiNode = simpleApp.guiNode; } if (guiFont == null ) { guiFont = simpleApp.guiFont; } } if (guiNode == null) { throw new RuntimeException( "No guiNode specific and cannot be automatically determined." ); } if (guiFont == null) { guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt"); } loadFpsText(); loadStatsView(); loadDarken(); }
@Override public void simpleInitApp() { BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); Context clContext = context.getOpenCLContext(); if (clContext == null) {
@Override public void simpleInitApp() { BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); Context clContext = context.getOpenCLContext(); if (clContext == null) {
private void makeHudText() { guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); hwsText = new BitmapText(guiFont, false); hwsText.setSize(guiFont.getCharSet().getRenderedSize()); hwsText.setText("HWS : "+ hwSkinningEnable); hwsText.setLocalTranslation(0, cam.getHeight(), 0); guiNode.attachChild(hwsText); } }
private void makeHudText() { guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); hwsText = new BitmapText(guiFont, false); hwsText.setSize(guiFont.getCharSet().getRenderedSize()); hwsText.setText("HWS : " + hwSkinningEnable); hwsText.setLocalTranslation(0, cam.getHeight(), 0); guiNode.attachChild(hwsText); } }
private void makeHudText() { guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); hwsText = new BitmapText(guiFont, false); hwsText.setSize(guiFont.getCharSet().getRenderedSize()); hwsText.setText("HWS : "+ hwSkinningEnable); hwsText.setLocalTranslation(0, cam.getHeight(), 0); guiNode.attachChild(hwsText); } }
public StatsView(String name, AssetManager manager, Statistics stats){ super(name); setQueueBucket(Bucket.Gui); setCullHint(CullHint.Never); statistics = stats; statistics.setEnabled(enabled); statLabels = statistics.getLabels(); statData = new int[statLabels.length]; BitmapFont font = manager.loadFont("Interface/Fonts/Console.fnt"); statText = new BitmapText(font); statText.setLocalTranslation(0, statText.getLineHeight() * statLabels.length, 0); attachChild(statText); addControl(this); }
protected void initCrossHairs() { 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); } }
/** A centred plus sign to help the player aim. */ protected void initCrossHairs() { setDisplayStatView(false); 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 - ch.getLineWidth()/2, settings.getHeight() / 2 + ch.getLineHeight()/2, 0); guiNode.attachChild(ch); }
protected void initCrossHairs() { 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); }
protected void initCrossHairs() { 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); } }
protected void initCrossHairs() { 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); } }
@Override public void simpleInitApp() { Quad q = new Quad(6, 3); Geometry g = new Geometry("quad", q); g.setLocalTranslation(0, -3, -0.0001f); g.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); rootNode.attachChild(g); BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); BitmapText txt = new BitmapText(fnt, false); txt.setBox(new Rectangle(0, 0, 6, 3)); txt.setQueueBucket(Bucket.Transparent); txt.setSize( 0.5f ); txt.setText(txtB); rootNode.attachChild(txt); }
private void convertAndPutImage(Image image, float posX, float posY) { Texture tex = new Texture2D(image); tex.setMagFilter(MagFilter.Nearest); tex.setMinFilter(MinFilter.NearestNoMipMaps); tex.setAnisotropicFilter(16); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", tex); Quad q = new Quad(5, 5); Geometry g = new Geometry("quad", q); g.setLocalTranslation(posX, posY - 5, -0.0001f); g.setMaterial(mat); rootNode.attachChild(g); BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); BitmapText txt = new BitmapText(fnt); txt.setBox(new Rectangle(0, 0, 5, 5)); txt.setQueueBucket(RenderQueue.Bucket.Transparent); txt.setSize(0.5f); txt.setText(image.getFormat().name()); txt.setLocalTranslation(posX, posY, 0); rootNode.attachChild(txt); }
@Override public void simpleInitApp() { inputManager.addMapping("WordWrap", new KeyTrigger(KeyInput.KEY_TAB)); inputManager.addListener(keyListener, "WordWrap"); inputManager.addRawInputListener(textListener); BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); txt = new BitmapText(fnt, false); txt.setBox(new Rectangle(0, 0, settings.getWidth(), settings.getHeight())); txt.setSize(fnt.getPreferredSize() * 2f); txt.setText(txtB); txt.setLocalTranslation(0, txt.getHeight(), 0); guiNode.attachChild(txt); txt2 = new BitmapText(fnt, false); txt2.setSize(fnt.getPreferredSize() * 1.2f); txt2.setText("Text without restriction. \nText without restriction. Text without restriction. Text without restriction"); txt2.setLocalTranslation(0, txt2.getHeight(), 0); guiNode.attachChild(txt2); txt3 = new BitmapText(fnt, false); txt3.setBox(new Rectangle(0, 0, settings.getWidth(), 0)); txt3.setText("Press Tab to toggle word-wrap. type text and enter to input text"); txt3.setLocalTranslation(0, settings.getHeight()/2, 0); guiNode.attachChild(txt3); }
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); BitmapText helloText = new BitmapText(guiFont, false); helloText.setSize(guiFont.getCharSet().getRenderedSize());
this.plsf = plsf; this.viewPort = viewPort; BitmapFont guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); shadowTypeText = createText(guiFont); shadowCompareText = createText(guiFont);