M core/src/net/dermetfan/someLibgdxTests/screens/AnimatedButtonTextColorTest.java +1 -1
@@ 43,7 43,7 @@ public class AnimatedButtonTextColorTest
TextButtonStyle style = new TextButtonStyle();
style.font = new BitmapFont();
- style.font.setScale(2);
+ style.font.getData().setScale(2);
style.fontColor = Color.WHITE;
style.pressedOffsetX = 1;
style.pressedOffsetY = -1;
M core/src/net/dermetfan/someLibgdxTests/screens/Box2DSpritePerformanceTest.java +1 -1
@@ 43,7 43,7 @@ public class Box2DSpritePerformanceTest
public void show() {
System.out.println("boxes: " + boxes + "\n, Box2DSprites: " + drawBox2DSprites);
- font.setScale(.05f);
+ font.getData().setScale(.05f);
batch = new SpriteBatch();
debugRenderer = new Box2DDebugRenderer();
camera = new OrthographicCamera();
M core/src/net/dermetfan/someLibgdxTests/screens/BugfixTest.java +1 -1
@@ 42,7 42,7 @@ public class BugfixTest implements Scree
TextButtonStyle tbs = new TextButtonStyle();
tbs.font = new BitmapFont();
- tbs.font.setScale(7);
+ tbs.font.getData().setScale(7);
tbs.fontColor = Color.WHITE;
tbs.overFontColor = Color.YELLOW;
tbs.downFontColor = Color.RED;
M core/src/net/dermetfan/someLibgdxTests/screens/CutsceneTest.java +2 -2
@@ 103,8 103,8 @@ public class CutsceneTest implements Scr
dialog = new Label("Get the item in a block by jumping against it", skin);
dialog.setWrap(true);
- dialog.getStyle().font.setScale(.1f);
- dialog.getStyle().background = skin.getDrawable("default.selection");
+ dialog.getStyle().font.getData().setScale(.4f);
+ dialog.getStyle().background = skin.getDrawable("default-select-selection");
dialog.setSize(player.getWidth() * 3, player.getHeight() + 10);
Timeline.createSequence().beginSequence().push(Tween.set(player, SpriteAccessor.POSITION).target(player.getX() + 4 * player.getCollisionLayer().getTileWidth(), player.getY() + player.getCollisionLayer().getTileHeight())).push(Tween.to(player, SpriteAccessor.X, 1.5f).target(player.getX() + 8 * player.getCollisionLayer().getTileWidth())).push(Tween.call(new TweenCallback() {
M core/src/net/dermetfan/someLibgdxTests/screens/GdxFreetypeExtensionWikiTest.java +8 -2
@@ 1,6 1,7 @@
package net.dermetfan.someLibgdxTests.screens;
import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
@@ 9,6 10,7 @@ import com.badlogic.gdx.graphics.g2d.Bit
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.math.MathUtils;
+import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.TimeUtils;
import net.dermetfan.someLibgdxTests.Assets;
@@ 36,7 38,7 @@ public class GdxFreetypeExtensionWikiTes
font.setColor(Color.WHITE);
batch.begin();
- font.drawWrapped(batch, text, Gdx.graphics.getWidth() / 2 - font.getWrappedBounds(text, Gdx.graphics.getWidth()).width / 2, Gdx.graphics.getHeight(), Gdx.graphics.getWidth());
+ font.draw(batch, text, 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth(), Align.center, true);
batch.end();
}
@@ 62,7 64,11 @@ public class GdxFreetypeExtensionWikiTes
@Override
public boolean keyDown(int keycode) {
- high = !high;
+ if(keycode == Keys.R) {
+ fontSize = 12;
+ high = false;
+ } else
+ high = !high;
return true;
}
});
M core/src/net/dermetfan/someLibgdxTests/screens/HorizontalScrollPaneWithButtonsTest.java +1 -1
@@ 59,7 59,7 @@ public class HorizontalScrollPaneWithBut
TextButtonStyle tbs = new TextButtonStyle(); // just some ugly TextButtonStyle, it has no background
tbs.font = new BitmapFont();
- tbs.font.setScale(10); // just for the eye and to make the buttons bigger to have something for the ScrollPane to scroll
+ tbs.font.getData().setScale(10); // just for the eye and to make the buttons bigger to have something for the ScrollPane to scroll
tbs.fontColor = Color.WHITE;
tbs.overFontColor = Color.YELLOW;
tbs.downFontColor = Color.RED;
M core/src/net/dermetfan/someLibgdxTests/screens/LanguageTest.java +3 -2
@@ 6,6 6,7 @@ import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
+import com.badlogic.gdx.utils.Align;
import net.dermetfan.gdx.Typewriter;
import net.dermetfan.someLibgdxTests.other.Language;
@@ 20,7 21,7 @@ public class LanguageTest extends InputA
public void show() {
batch = new SpriteBatch();
font = new BitmapFont();
- font.scale(1.5f);
+ font.getData().setScale(1.5f);
System.out.println(Gdx.files.internal("languages.json").readString());
Language man = new Language();
@@ 38,7 39,7 @@ public class LanguageTest extends InputA
public void render(float delta) {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
- font.drawWrapped(batch, typewriter.updateAndType(text, delta), 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth());
+ font.draw(batch, typewriter.updateAndType(text, delta), 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth(), Align.left, true);
batch.end();
}
M core/src/net/dermetfan/someLibgdxTests/screens/SeraphissLabelFadeOutSetTextFadeInTest.java +1 -1
@@ 47,7 47,7 @@ public class SeraphissLabelFadeOutSetTex
// some example label
LabelStyle style = new LabelStyle(new BitmapFont(), Color.WHITE);
- style.font.setScale(5);
+ style.font.getData().setScale(5);
final Label label = new Label("first text", style); // final because of the callbacks
// position in center of the screen
M core/src/net/dermetfan/someLibgdxTests/screens/TooltipTest.java +1 -2
@@ 12,8 12,8 @@ import com.badlogic.gdx.scenes.scene2d.S
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Window;
-import com.badlogic.gdx.scenes.scene2d.utils.Align;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
+import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import net.dermetfan.gdx.scenes.scene2d.ui.FileChooser.Listener;
@@ 26,7 26,6 @@ import net.dermetfan.gdx.scenes.scene2d.
import net.dermetfan.gdx.scenes.scene2d.ui.Popup.TooltipBehavior;
import net.dermetfan.gdx.scenes.scene2d.ui.TreeFileChooser;
import net.dermetfan.someLibgdxTests.Assets;
-import net.dermetfan.someLibgdxTests.SomeLibgdxTests;
public class TooltipTest extends ScreenAdapter {
M core/src/net/dermetfan/someLibgdxTests/screens/TypewriterTest.java +3 -2
@@ 6,13 6,14 @@ import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Interpolation;
+import com.badlogic.gdx.utils.Align;
import net.dermetfan.gdx.Typewriter;
public class TypewriterTest implements Screen {
private SpriteBatch batch;
private BitmapFont font;
- private String text = "This is a long multiline string. Some text that you can read through in a RPG, that scrolls like in the pokemon games or something";
+ private String text = "This is a long multiline string. Some text that you can read through in a RPG, that scrolls like in the pokemon games or something. This is a long multiline string. Some text that you can read through in a RPG, that scrolls like in the pokemon games or something. This is a long multiline string. Some text that you can read through in a RPG, that scrolls like in the pokemon games or something";
private Typewriter typewriter = new Typewriter();
@Override
@@ 28,7 29,7 @@ public class TypewriterTest implements S
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
- font.drawWrapped(batch, typewriter.updateAndType(text, delta), 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth());
+ font.draw(batch, typewriter.updateAndType(text, delta), 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth(), Align.left, true);
batch.end();
}
M desktop/src/net/dermetfan/someLibgdxTests/desktop/BugfixTest.java +1 -1
@@ 76,7 76,7 @@ public class BugfixTest extends Game {
TextButtonStyle tbs = new TextButtonStyle();
tbs.font = new BitmapFont();
- tbs.font.setScale(7);
+ tbs.font.getData().setScale(7);
tbs.fontColor = Color.WHITE;
tbs.overFontColor = Color.YELLOW;
tbs.downFontColor = Color.RED;
M desktop/src/net/dermetfan/someLibgdxTests/desktop/InterpolationTest.java +2 -1
@@ 16,6 16,7 @@
package net.dermetfan.someLibgdxTests.desktop;
+import com.badlogic.gdx.utils.Align;
import net.dermetfan.someLibgdxTests.other.GdxTest;
import com.badlogic.gdx.Gdx;
@@ 158,7 159,7 @@ public class InterpolationTest extends G
text = text.substring(0, text.lastIndexOf('.') + 3);
text = "duration: " + text + " s (ctrl + scroll to change)";
stage.getBatch().begin();
- list.getStyle().font.draw(stage.getBatch(), text, bottomLeftX + graphSize / 2 - list.getStyle().font.getBounds(text).width / 2, bottomLeftY + graphSize + list.getStyle().font.getLineHeight());
+ list.getStyle().font.draw(stage.getBatch(), text, bottomLeftX + graphSize / 2, bottomLeftY + graphSize + list.getStyle().font.getLineHeight(), graphSize, Align.center, true);
stage.getBatch().end();
renderer.begin(ShapeType.Line);
M desktop/src/net/dermetfan/someLibgdxTests/desktop/LabelBugTest.java +1 -1
@@ 32,7 32,7 @@ public class LabelBugTest implements App
shapeRenderer.rect(dialog.getX(), dialog.getY(), dialog.getWidth(), dialog.getHeight());
shapeRenderer.end();
- dialog.getStyle().font.setScale(scale);
+ dialog.getStyle().font.getData().setScale(scale);
dialog.setText("Use the mouse wheel to scale the font... scale: " + scale);
stage.act();