Back to project page Station42.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project Station42 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.station42.world; // ww w. j av a 2 s .co m import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector3; import com.station42.base.Engine; import com.station42.base.EngineRenderer; import com.station42.base.Entity; import com.station42.basic.EntitySprite; import com.sun.prism.GraphicsPipeline.ShaderType; public class WorldUI implements EngineRenderer { Entity player; BitmapFont font; public WorldUI(Entity player, BitmapFont font) { this.player = player; this.font = font; } @Override public void render(Engine engine, SpriteBatch batch, Rectangle viewport) { float ouyaBorder = 0.05f; Vector3 newLocation = new Vector3(); newLocation.set(-64f / viewport.width, -1 + 32f / viewport.height + ouyaBorder, 0); newLocation.mul(engine.inverted); font.setColor(player.getComponent(World.class).getColor()); font.draw(batch, "Current world:" + player.getComponent(World.class).name, newLocation.x, newLocation.y); } }