dimanche 3 mai 2015

java, libgdx - cant get custom font to appear

i have the following class that is suppose to reference a font and then draw a string to the screen once an event has occured. the class is called like this .

if (grumpface.whiteballoon.getBoundingRectangle().overlaps(spriterect)) {


            gameoverscreen = new GameOverScreen();
        }
        ;

the class it references it this but i still cant get the font to appear any suggestiosns?

class GameOverScreen implements Screen{

    private Stage stage;

    // Called automatically once for init objects
    @Override
    public void show() { 
        stage = new Stage();

       stage.setDebugAll(true); // Set outlines for Stage elements for easy debug

        BitmapFont white = new BitmapFont(Gdx.files.internal("hazey.fnt"), false);
        LabelStyle headingStyle = new LabelStyle(white, Color.BLACK);
        Label gameoverstring = new Label("game ovaaaa!", headingStyle);
        gameoverstring.setPosition(100, 100);
        stage.addActor(gameoverstring);


    }

    // Called every frame so try to put no object creation in it
    @Override
    public void render(float delta) { 
        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);


       stage.act(delta);

        stage.draw();



    }

Aucun commentaire:

Enregistrer un commentaire