Android Open Source - square-libgdx Font






From Project

Back to project page square-libgdx.

License

The source code is released under:

GNU General Public License

If you think the Android project square-libgdx listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.denzyldick.square;
//from  w w w . ja v  a2  s.  c o  m
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;

public class Font {
  private BitmapFont font;
  private FreeTypeFontGenerator fontGenerator;
  private int fontSize = 20;
  private Color fontColor =  Color.RED;
  
  public Font()
  {
    fontGenerator = new FreeTypeFontGenerator(
        Gdx.files.internal("font/font.ttf"));
    font = fontGenerator.generateFont(fontSize);
    fontGenerator.scaleForPixelHeight(Gdx.graphics.getHeight());
    fontGenerator.dispose();
    font.setColor(fontColor);
  }
  
  public BitmapFont getFont()
  {
    return font;
  }
  public void setColor(Color color)
  {
    this.fontColor = color;
  }
  public void dispose()
  {
    font.dispose();
  }
}




Java Source Code List

actors.Square.java
com.denzyldick.square.Assets.java
com.denzyldick.square.BackgroundAnimation.java
com.denzyldick.square.File.java
com.denzyldick.square.Font.java
com.denzyldick.square.Main.java
com.denzyldick.square.SoundManager.java
com.denzyldick.square.SquareMain.java
com.denzyldick.square.StarManagement.java
com.denzyldick.square.client.GwtLauncher.java
com.denzyldick.square.json.JsonArray.java
com.denzyldick.square.json.JsonLiteral.java
com.denzyldick.square.json.JsonNumber.java
com.denzyldick.square.json.JsonObject.java
com.denzyldick.square.json.JsonParser.java
com.denzyldick.square.json.JsonString.java
com.denzyldick.square.json.JsonValue.java
com.denzyldick.square.json.JsonWriter.java
com.denzyldick.square.json.ParseException.java
com.realcode.square.MainActivity.java
screens.GameMenu.java
screens.GameScreen.java
screens.LostScreen.java
screens.MenuScreen.java
screens.OptionsScreen.java
screens.SplashScreen.java
screens.TutorialScreen.java
screens.WonScreen.java