Commit ff4ebb4d authored by Nils Hein's avatar Nils Hein
Browse files

Nummern in den Bubbles lesbarer gemacht

parent 38a5b715
......@@ -14,6 +14,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
......@@ -306,24 +307,30 @@ public class GameScreen implements Screen {
}
private void drawTextCentered(String text, float x, float y, Color c) {
GlyphLayout layout = new GlyphLayout();
layout.setText(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), text);
Actor rotaater;
Label myLabel = new Label(text, new Label.LabelStyle(FrozenNumbersGame.assets.get("size20.ttf", BitmapFont.class), c));
Table container = new Table();
container.setTransform(true);
container.add(myLabel);
rotaater = container;
rotaater.setPosition(x - (rotaater.getWidth() / 2), (y - bubblradius / 4) + bubblradius / 2);
Label myLabel = new Label(text, new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), c));
Label myLabel2 = new Label(text, new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), c));
myLabel.setSize(bubblradius/2,bubblradius/4);
myLabel2.setSize(bubblradius/2,bubblradius/4);
myLabel.setScale(0.5f);
myLabel2.setScale(0.5f);
myLabel2.setPosition(x-myLabel.getWidth()*0.5f,y-myLabel.getWidth());
Group g = new Group();
rotaater = g;
g.addActor(myLabel);
g.setSize(bubblradius,bubblradius);
g.setPosition(x+myLabel.getWidth()*0.5f,y+myLabel.getWidth());
rotaater.setRotation(180);
rotaater.draw(FrozenNumbersGame.batch, 1);
myLabel.setPosition(x - (myLabel.getWidth() / 2), (y - bubblradius / 4) - bubblradius / 2);
myLabel.draw(FrozenNumbersGame.batch, 1);
g.draw(FrozenNumbersGame.batch,1);
myLabel2.draw(FrozenNumbersGame.batch,1);
}
@Override
public void resize(int width, int height) {
wWidth = FrozenNumbersGame.viewport.getWorldWidth();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment