Exemplo n.º 1
0
  private void createTextPlanes() {
    FontProducer _myFontProducer =
        Bitmaps.getFontProducer(
            Resource.getStream("resource/data/demo/font/silkscreen/slkscr.ttf"));
    _myFontProducer.setSize(32);
    _myFontProducer.setQuality(Gestalt.FONT_QUALITY_HIGH);

    _myFontPlane = new Plane[10];
    _myFontTexture = new TexturePlugin[_myFontPlane.length];
    for (int i = 0; i < _myFontPlane.length; ++i) {
      System.out.println("### INFO / creating texture " + (i + 1) + "/" + _myFontPlane.length);

      _myFontTexture[i] = drawablefactory().texture();
      _myFontTexture[i].load(_myFontProducer.getBitmap("***** " + i + " *****"));

      _myFontPlane[i] = drawablefactory().plane();
      _myFontPlane[i].material().color4f().set((float) i / (float) _myFontPlane.length);
      _myFontPlane[i].material().depthtest = false;
      _myFontPlane[i].material().addPlugin(_myFontTexture[i]);
      _myFontPlane[i].setPlaneSizeToTextureSize();
      _myFontPlane[i].transform().translation.z = i * -10;
      bin(BIN_3D).add(_myFontPlane[i]);
    }
  }