mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Update Libgdx to 1.9.10
This commit is contained in:
committed by
Anthony Calosa
parent
47a1b6ea98
commit
5e88cc67e4
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -63,12 +63,12 @@
|
||||
<dependency>
|
||||
<groupId>com.badlogicgames.gdx</groupId>
|
||||
<artifactId>gdx</artifactId>
|
||||
<version>1.5.5</version>
|
||||
<version>1.9.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.badlogicgames.gdx</groupId>
|
||||
<artifactId>gdx-freetype</artifactId>
|
||||
<version>1.5.5</version>
|
||||
<version>1.9.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
@@ -20,7 +18,7 @@ import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.util.Utils;
|
||||
|
||||
import forge.util.TextBounds;
|
||||
import java.util.Stack;
|
||||
|
||||
public class Graphics {
|
||||
@@ -602,10 +600,10 @@ public class Graphics {
|
||||
batch.draw(image, adjustX(x), adjustY(y, h), originX - x, h - (originY - y), w, h, 1, 1, rotation, srcX, srcY, srcWidth, srcHeight, false, false);
|
||||
}
|
||||
|
||||
public void drawText(String text, FSkinFont font, FSkinColor skinColor, float x, float y, float w, float h, boolean wrap, HAlignment horzAlignment, boolean centerVertically) {
|
||||
public void drawText(String text, FSkinFont font, FSkinColor skinColor, float x, float y, float w, float h, boolean wrap, int horzAlignment, boolean centerVertically) {
|
||||
drawText(text, font, skinColor.getColor(), x, y, w, h, wrap, horzAlignment, centerVertically);
|
||||
}
|
||||
public void drawText(String text, FSkinFont font, Color color, float x, float y, float w, float h, boolean wrap, HAlignment horzAlignment, boolean centerVertically) {
|
||||
public void drawText(String text, FSkinFont font, Color color, float x, float y, float w, float h, boolean wrap, int horzAlignment, boolean centerVertically) {
|
||||
if (alphaComposite < 1) {
|
||||
color = FSkinColor.alphaColor(color, color.a * alphaComposite);
|
||||
}
|
||||
@@ -660,7 +658,7 @@ public class Graphics {
|
||||
}
|
||||
|
||||
//use nifty trick with multiple text renders to draw outlined text
|
||||
public void drawOutlinedText(String text, FSkinFont skinFont, Color textColor, Color outlineColor, float x, float y, float w, float h, boolean wrap, HAlignment horzAlignment, boolean centerVertically) {
|
||||
public void drawOutlinedText(String text, FSkinFont skinFont, Color textColor, Color outlineColor, float x, float y, float w, float h, boolean wrap, int horzAlignment, boolean centerVertically) {
|
||||
drawText(text, skinFont, outlineColor, x - 1, y, w, h, wrap, horzAlignment, centerVertically);
|
||||
drawText(text, skinFont, outlineColor, x, y - 1, w, h, wrap, horzAlignment, centerVertically);
|
||||
drawText(text, skinFont, outlineColor, x - 1, y - 1, w, h, wrap, horzAlignment, centerVertically);
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import forge.Graphics;
|
||||
|
||||
public class GifAnimation extends ForgeAnimation {
|
||||
private final Animation animation;
|
||||
private final Animation<TextureRegion> animation;
|
||||
private TextureRegion currentFrame;
|
||||
private float stateTime;
|
||||
|
||||
|
||||
@@ -5,13 +5,8 @@ import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.graphics.g2d.*;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
|
||||
import com.badlogic.gdx.graphics.glutils.PixmapTextureData;
|
||||
@@ -19,8 +14,8 @@ import com.badlogic.gdx.utils.Array;
|
||||
import forge.FThreads;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.FileUtil;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -31,6 +26,7 @@ public class FSkinFont {
|
||||
|
||||
private static final String TTF_FILE = "font1.ttf";
|
||||
private static final Map<Integer, FSkinFont> fonts = new HashMap<Integer, FSkinFont>();
|
||||
private static final GlyphLayout layout = new GlyphLayout();
|
||||
|
||||
static {
|
||||
FileUtil.ensureDirectoryExists(ForgeConstants.FONTS_DIR);
|
||||
@@ -98,15 +94,22 @@ public class FSkinFont {
|
||||
// Expose methods from font that updates scale as needed
|
||||
public TextBounds getBounds(CharSequence str) {
|
||||
updateScale(); //must update scale before measuring text
|
||||
return font.getBounds(str);
|
||||
layout.setText(font, str);
|
||||
return new TextBounds(layout.width, layout.height);
|
||||
|
||||
}
|
||||
public TextBounds getMultiLineBounds(CharSequence str) {
|
||||
updateScale();
|
||||
return font.getMultiLineBounds(str);
|
||||
layout.setText(font, str);
|
||||
return new TextBounds(layout.width, layout.height);
|
||||
|
||||
}
|
||||
public TextBounds getWrappedBounds(CharSequence str, float wrapWidth) {
|
||||
updateScale();
|
||||
return font.getWrappedBounds(str, wrapWidth);
|
||||
layout.setText(font, str);
|
||||
layout.width = wrapWidth;
|
||||
return new TextBounds(layout.width, layout.height);
|
||||
|
||||
}
|
||||
public float getAscent() {
|
||||
updateScale();
|
||||
@@ -121,20 +124,16 @@ public class FSkinFont {
|
||||
return font.getLineHeight();
|
||||
}
|
||||
|
||||
public void draw(SpriteBatch batch, String text, Color color, float x, float y, float w, boolean wrap, HAlignment horzAlignment) {
|
||||
public void draw(SpriteBatch batch, String text, Color color, float x, float y, float w, boolean wrap, int horzAlignment) {
|
||||
updateScale();
|
||||
font.setColor(color);
|
||||
if (wrap) {
|
||||
font.drawWrapped(batch, text, x, y, w, horzAlignment);
|
||||
} else {
|
||||
font.drawMultiLine(batch, text, x, y, w, horzAlignment);
|
||||
}
|
||||
font.draw(batch, text, x, y, w, horzAlignment, wrap);
|
||||
}
|
||||
|
||||
//update scale of font if needed
|
||||
private void updateScale() {
|
||||
if (font.getScaleX() != scale) {
|
||||
font.setScale(scale);
|
||||
font.getData().setScale(scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +186,7 @@ public class FSkinFont {
|
||||
|
||||
//only generate images for characters that could be used by Forge
|
||||
String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!?'.,;:()[]{}<>|/@\\^$-%+=#_&*\u2014\u2022";
|
||||
|
||||
chars += "ÁÉÍÓÚáéíóúÀÈÌÒÙàèìòùÑñÄËÏÖÜäëïöüẞß";
|
||||
final PixmapPacker packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 2, false);
|
||||
final FreeTypeFontParameter parameter = new FreeTypeFontParameter();
|
||||
parameter.characters = chars;
|
||||
@@ -200,7 +199,7 @@ public class FSkinFont {
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
TextureRegion[] textureRegions = new TextureRegion[pages.size];
|
||||
Array<TextureRegion> textureRegions = new Array<>();
|
||||
for (int i = 0; i < pages.size; i++) {
|
||||
PixmapPacker.Page p = pages.get(i);
|
||||
Texture texture = new Texture(new PixmapTextureData(p.getPixmap(), p.getPixmap().getFormat(), false, false)) {
|
||||
@@ -211,7 +210,7 @@ public class FSkinFont {
|
||||
}
|
||||
};
|
||||
texture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
|
||||
textureRegions[i] = new TextureRegion(texture);
|
||||
textureRegions.addAll(new TextureRegion(texture));
|
||||
}
|
||||
|
||||
font = new BitmapFont(fontData, textureRegions, true);
|
||||
|
||||
@@ -6,14 +6,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.card.CardFaceSymbols;
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.TextBounds;
|
||||
|
||||
//Encodes text for drawing with symbols and reminder text
|
||||
public class TextRenderer {
|
||||
@@ -528,10 +527,10 @@ public class TextRenderer {
|
||||
return getCurrentBounds();
|
||||
}
|
||||
|
||||
public void drawText(Graphics g, String text, FSkinFont skinFont, FSkinColor skinColor, float x, float y, float w, float h, float visibleStartY, float visibleHeight, boolean wrap0, HAlignment horzAlignment, boolean centerVertically) {
|
||||
public void drawText(Graphics g, String text, FSkinFont skinFont, FSkinColor skinColor, float x, float y, float w, float h, float visibleStartY, float visibleHeight, boolean wrap0, int horzAlignment, boolean centerVertically) {
|
||||
drawText(g, text, skinFont, skinColor.getColor(), x, y, w, h, visibleStartY, visibleHeight, wrap0, horzAlignment, centerVertically);
|
||||
}
|
||||
public void drawText(Graphics g, String text, FSkinFont skinFont, Color color, float x, float y, float w, float h, float visibleStartY, float visibleHeight, boolean wrap0, HAlignment horzAlignment, boolean centerVertically) {
|
||||
public void drawText(Graphics g, String text, FSkinFont skinFont, Color color, float x, float y, float w, float h, float visibleStartY, float visibleHeight, boolean wrap0, int horzAlignment, boolean centerVertically) {
|
||||
setProps(text, skinFont, w, h, wrap0);
|
||||
if (needClip) { //prevent text flowing outside region if couldn't shrink it to fit
|
||||
g.startClip(x, y, w, h);
|
||||
@@ -542,13 +541,13 @@ public class TextRenderer {
|
||||
float[] alignmentOffsets = new float[lineWidths.size()];
|
||||
for (int i = 0; i < lineWidths.size(); i++) {
|
||||
switch (horzAlignment) {
|
||||
case LEFT:
|
||||
case Align.left:
|
||||
alignmentOffsets[i] = 0;
|
||||
break;
|
||||
case CENTER:
|
||||
case Align.center:
|
||||
alignmentOffsets[i] = Math.max((width - lineWidths.get(i)) / 2, 0);
|
||||
break;
|
||||
case RIGHT:
|
||||
case Align.right:
|
||||
alignmentOffsets[i] = Math.max(width - lineWidths.get(i), 0);
|
||||
break;
|
||||
}
|
||||
@@ -603,7 +602,7 @@ public class TextRenderer {
|
||||
else if (inReminderText) {
|
||||
color = FSkinColor.alphaColor(color, ALPHA_COMPOSITE);
|
||||
}
|
||||
g.drawText(text, font, color, x + offsetX, y + offsetY, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(text, font, color, x + offsetX, y + offsetY, w, h, false, Align.left, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.card;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import forge.Graphics;
|
||||
import forge.assets.*;
|
||||
@@ -175,7 +175,7 @@ public class CardImageRenderer {
|
||||
CardFaceSymbols.drawManaCost(g, otherManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
//draw "//" between two parts of mana cost
|
||||
manaCostWidth += NAME_FONT.getBounds("//").width + HEADER_PADDING;
|
||||
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, Align.left, true);
|
||||
}
|
||||
manaCostWidth += CardFaceSymbols.getWidth(mainManaCost, MANA_SYMBOL_SIZE) + HEADER_PADDING;
|
||||
CardFaceSymbols.drawManaCost(g, mainManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
@@ -183,7 +183,7 @@ public class CardImageRenderer {
|
||||
//draw name for card
|
||||
x += padding;
|
||||
w -= 2 * padding;
|
||||
g.drawText(state.getName(), NAME_FONT, Color.BLACK, x, y, w - manaCostWidth - padding, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(state.getName(), NAME_FONT, Color.BLACK, x, y, w - manaCostWidth - padding, h, false, Align.left, true);
|
||||
}
|
||||
|
||||
public static final FBufferedImage forgeArt;
|
||||
@@ -221,7 +221,7 @@ public class CardImageRenderer {
|
||||
|
||||
//draw type
|
||||
x += padding;
|
||||
g.drawText(CardDetailUtil.formatCardType(state, canShow), TYPE_FONT, Color.BLACK, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(CardDetailUtil.formatCardType(state, canShow), TYPE_FONT, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
}
|
||||
|
||||
//use text renderer to handle mana symbols and reminder text
|
||||
@@ -268,7 +268,7 @@ public class CardImageRenderer {
|
||||
y += padding;
|
||||
w -= 2 * padding;
|
||||
h -= 2 * padding;
|
||||
cardTextRenderer.drawText(g, text, TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, HAlignment.LEFT, true);
|
||||
cardTextRenderer.drawText(g, text, TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, Align.left, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public class CardImageRenderer {
|
||||
|
||||
x += (boxWidth - totalPieceWidth) / 2;
|
||||
for (int i = 0; i < pieces.size(); i++) {
|
||||
g.drawText(pieces.get(i), PT_FONT, Color.BLACK, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(pieces.get(i), PT_FONT, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
x += pieceWidths[i];
|
||||
}
|
||||
}
|
||||
@@ -451,7 +451,7 @@ public class CardImageRenderer {
|
||||
CardFaceSymbols.drawManaCost(g, otherManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
//draw "//" between two parts of mana cost
|
||||
manaCostWidth += NAME_FONT.getBounds("//").width + HEADER_PADDING;
|
||||
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText("//", NAME_FONT, Color.BLACK, x + w - manaCostWidth, y, w, h, false, Align.left, true);
|
||||
}
|
||||
manaCostWidth += CardFaceSymbols.getWidth(mainManaCost, MANA_SYMBOL_SIZE) + HEADER_PADDING;
|
||||
CardFaceSymbols.drawManaCost(g, mainManaCost, x + w - manaCostWidth, y + (h - MANA_SYMBOL_SIZE) / 2, MANA_SYMBOL_SIZE);
|
||||
@@ -460,7 +460,7 @@ public class CardImageRenderer {
|
||||
//draw name for card
|
||||
x += padding;
|
||||
w -= 2 * padding;
|
||||
g.drawText(CardDetailUtil.formatCardName(card, canShow, state == card.getAlternateState()), NAME_FONT, Color.BLACK, x, y, w - manaCostWidth - padding, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(CardDetailUtil.formatCardName(card, canShow, state == card.getAlternateState()), NAME_FONT, Color.BLACK, x, y, w - manaCostWidth - padding, h, false, Align.left, true);
|
||||
|
||||
//draw type and set label for card
|
||||
y += h;
|
||||
@@ -478,7 +478,7 @@ public class CardImageRenderer {
|
||||
w -= setWidth; //reduce available width for type
|
||||
}
|
||||
|
||||
g.drawText(CardDetailUtil.formatCardType(state, canShow), TYPE_FONT, Color.BLACK, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(CardDetailUtil.formatCardType(state, canShow), TYPE_FONT, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
}
|
||||
|
||||
private static void drawDetailsTextBox(Graphics g, CardStateView state, GameView gameView, boolean canShow, Color[] colors, float x, float y, float w, float h) {
|
||||
@@ -491,14 +491,14 @@ public class CardImageRenderer {
|
||||
y += padY;
|
||||
w -= 2 * padX;
|
||||
h -= 2 * padY;
|
||||
cardTextRenderer.drawText(g, CardDetailUtil.composeCardText(state, gameView, canShow), TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, HAlignment.LEFT, false);
|
||||
cardTextRenderer.drawText(g, CardDetailUtil.composeCardText(state, gameView, canShow), TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, Align.left, false);
|
||||
}
|
||||
|
||||
private static void drawDetailsIdAndPtBox(Graphics g, CardView card, CardStateView state, boolean canShow, Color idForeColor, Color[] colors, float x, float y, float w, float h) {
|
||||
float idWidth = 0;
|
||||
if (canShow) {
|
||||
String idText = CardDetailUtil.formatCardId(state);
|
||||
g.drawText(idText, TYPE_FONT, idForeColor, x, y + TYPE_FONT.getCapHeight() / 2, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(idText, TYPE_FONT, idForeColor, x, y + TYPE_FONT.getCapHeight() / 2, w, h, false, Align.left, false);
|
||||
idWidth = TYPE_FONT.getBounds(idText).width;
|
||||
}
|
||||
|
||||
@@ -513,6 +513,6 @@ public class CardImageRenderer {
|
||||
|
||||
fillColorBackground(g, colors, x, y, w, h);
|
||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||
g.drawText(ptText, PT_FONT, Color.BLACK, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(ptText, PT_FONT, Color.BLACK, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.card;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import forge.item.PaperCard;
|
||||
@@ -14,7 +14,7 @@ public class CardListPreview extends FLabel {
|
||||
|
||||
public CardListPreview(FChoiceList<PaperCard> list0) {
|
||||
super(new FLabel.Builder().iconScaleFactor(1).insets(new Vector2(0, 0))
|
||||
.iconInBackground(true).align(HAlignment.CENTER));
|
||||
.iconInBackground(true).align(Align.center));
|
||||
list = list0;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
|
||||
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
|
||||
import com.badlogic.gdx.graphics.glutils.PixmapTextureData;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import forge.CachedCardImage;
|
||||
import forge.FThreads;
|
||||
@@ -40,7 +40,7 @@ import forge.screens.match.MatchController;
|
||||
import forge.toolbox.FList;
|
||||
import forge.util.Utils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import forge.util.TextBounds;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -95,6 +95,7 @@ public class CardRenderer {
|
||||
private static Map<Integer, BitmapFont> counterFonts = new HashMap<>();
|
||||
private static final Color counterBackgroundColor = new Color(0f, 0f, 0f, 0.9f);
|
||||
private static final Map<CounterType, Color> counterColorCache = new HashMap<>();
|
||||
private static final GlyphLayout layout = new GlyphLayout();
|
||||
|
||||
static {
|
||||
try {
|
||||
@@ -261,7 +262,7 @@ public class CardRenderer {
|
||||
if (suffix != null) {
|
||||
name += suffix;
|
||||
}
|
||||
g.drawText(name, font, foreColor, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(name, font, foreColor, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +311,7 @@ public class CardRenderer {
|
||||
CardFaceSymbols.drawManaCost(g, otherManaCost, x + w - manaCostWidth + MANA_COST_PADDING, y, MANA_SYMBOL_SIZE);
|
||||
//draw "//" between two parts of mana cost
|
||||
manaCostWidth += font.getBounds("//").width + MANA_COST_PADDING;
|
||||
g.drawText("//", font, foreColor, x + w - manaCostWidth + MANA_COST_PADDING, y, w, MANA_SYMBOL_SIZE, false, HAlignment.LEFT, true);
|
||||
g.drawText("//", font, foreColor, x + w - manaCostWidth + MANA_COST_PADDING, y, w, MANA_SYMBOL_SIZE, false, Align.left, true);
|
||||
}
|
||||
manaCostWidth += CardFaceSymbols.getWidth(mainManaCost, MANA_SYMBOL_SIZE);
|
||||
CardFaceSymbols.drawManaCost(g, mainManaCost, x + w - manaCostWidth, y, MANA_SYMBOL_SIZE);
|
||||
@@ -323,7 +324,7 @@ public class CardRenderer {
|
||||
if (suffix != null) {
|
||||
name += suffix;
|
||||
}
|
||||
g.drawText(name, font, foreColor, x, y, w - manaCostWidth - cardArtWidth - FList.PADDING, MANA_SYMBOL_SIZE, false, HAlignment.LEFT, true);
|
||||
g.drawText(name, font, foreColor, x, y, w - manaCostWidth - cardArtWidth - FList.PADDING, MANA_SYMBOL_SIZE, false, Align.left, true);
|
||||
|
||||
if (compactMode) {
|
||||
return; //skip second line if rendering in compact mode
|
||||
@@ -350,7 +351,7 @@ public class CardRenderer {
|
||||
else if (card.getCurrentState().getType().hasSubtype("Vehicle")) {
|
||||
type += String.format(" [%s / %s]", power, toughness);
|
||||
}
|
||||
g.drawText(type, typeFont, foreColor, x, y, availableTypeWidth, lineHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(type, typeFont, foreColor, x, y, availableTypeWidth, lineHeight, false, Align.left, true);
|
||||
}
|
||||
|
||||
public static boolean cardListItemTap(List<?> cards, int selectedIndex, ActivateHandler activateHandler, float x, float y, int count, boolean compactMode) {
|
||||
@@ -379,7 +380,7 @@ public class CardRenderer {
|
||||
Color backColor = getRarityColor(rarity);
|
||||
Color foreColor = FSkinColor.getHighContrastColor(backColor);
|
||||
g.fillRect(backColor, x, y, w, h);
|
||||
g.drawText(set, font, foreColor, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(set, font, foreColor, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
|
||||
public static void drawCard(Graphics g, IPaperCard pc, float x, float y, float w, float h, CardStackPosition pos) {
|
||||
@@ -447,7 +448,7 @@ public class CardRenderer {
|
||||
//draw name and mana cost overlays if card is small or default card image being used
|
||||
if (h <= NAME_COST_THRESHOLD && canShow) {
|
||||
if (showCardNameOverlay(card)) {
|
||||
g.drawOutlinedText(details.getName(), FSkinFont.forHeight(h * 0.18f), Color.WHITE, Color.BLACK, x + padding, y + padding, w - 2 * padding, h * 0.4f, true, HAlignment.LEFT, false);
|
||||
g.drawOutlinedText(details.getName(), FSkinFont.forHeight(h * 0.18f), Color.WHITE, Color.BLACK, x + padding, y + padding, w - 2 * padding, h * 0.4f, true, Align.left, false);
|
||||
}
|
||||
if (showCardManaCostOverlay(card)) {
|
||||
float manaSymbolSize = w / 4;
|
||||
@@ -476,7 +477,7 @@ public class CardRenderer {
|
||||
if (canShow && showCardIdOverlay(card)) {
|
||||
FSkinFont idFont = FSkinFont.forHeight(h * 0.12f);
|
||||
float idHeight = idFont.getCapHeight();
|
||||
g.drawOutlinedText(String.valueOf(card.getId()), idFont, Color.WHITE, Color.BLACK, x + padding, y + h - idHeight - padding, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawOutlinedText(String.valueOf(card.getId()), idFont, Color.WHITE, Color.BLACK, x + padding, y + h - idHeight - padding, w, h, false, Align.left, false);
|
||||
}
|
||||
|
||||
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
|
||||
@@ -556,7 +557,11 @@ public class CardRenderer {
|
||||
maxCounters = Math.max(maxCounters, numberOfCounters);
|
||||
}
|
||||
|
||||
if (counterBoxBaseWidth + font.getBounds(String.valueOf(maxCounters)).width > w) {
|
||||
//if (counterBoxBaseWidth + font.getBounds(String.valueOf(maxCounters)).width > w) {
|
||||
layout.setText(font, String.valueOf(maxCounters));
|
||||
|
||||
if (counterBoxBaseWidth + layout.width > w) {
|
||||
|
||||
drawCounterImage(card, g, x, y, w, h);
|
||||
return;
|
||||
}
|
||||
@@ -567,7 +572,9 @@ public class CardRenderer {
|
||||
|
||||
final CounterType counter = counterEntry.getKey();
|
||||
final int numberOfCounters = counterEntry.getValue();
|
||||
final float counterBoxRealWidth = counterBoxBaseWidth + font.getBounds(String.valueOf(numberOfCounters)).width + 4;
|
||||
//final float counterBoxRealWidth = counterBoxBaseWidth + font.getBounds(String.valueOf(numberOfCounters)).width + 4;
|
||||
layout.setText(font, String.valueOf(numberOfCounters));
|
||||
final float counterBoxRealWidth = counterBoxBaseWidth + layout.width + 4;
|
||||
|
||||
final float counterYOffset = spaceFromTopOfCard - (currentCounter++ * (counterBoxHeight + counterBoxSpacing));
|
||||
|
||||
@@ -579,8 +586,8 @@ public class CardRenderer {
|
||||
|
||||
Color counterColor = counterColorCache.get(counter);
|
||||
|
||||
drawText(g, counter.getCounterOnCardDisplayName(), font, counterColor, x + 2 + additionalXOffset, counterYOffset, counterBoxRealWidth, counterBoxHeight, HAlignment.LEFT);
|
||||
drawText(g, String.valueOf(numberOfCounters), font, counterColor, x + counterBoxBaseWidth - 4f - additionalXOffset, counterYOffset, counterBoxRealWidth, counterBoxHeight, HAlignment.LEFT);
|
||||
drawText(g, counter.getCounterOnCardDisplayName(), font, counterColor, x + 2 + additionalXOffset, counterYOffset, counterBoxRealWidth, counterBoxHeight, Align.left);
|
||||
drawText(g, String.valueOf(numberOfCounters), font, counterColor, x + counterBoxBaseWidth - 4f - additionalXOffset, counterYOffset, counterBoxRealWidth, counterBoxHeight, Align.left);
|
||||
|
||||
}
|
||||
|
||||
@@ -588,13 +595,14 @@ public class CardRenderer {
|
||||
|
||||
private static final int GL_BLEND = GL20.GL_BLEND;
|
||||
|
||||
private static void drawText(Graphics g, String text, BitmapFont font, Color color, float x, float y, float w, float h, HAlignment horizontalAlignment) {
|
||||
private static void drawText(Graphics g, String text, BitmapFont font, Color color, float x, float y, float w, float h, int horizontalAlignment) {
|
||||
|
||||
if (color.a < 1) { //enable blending so alpha colored shapes work properly
|
||||
Gdx.gl.glEnable(GL_BLEND);
|
||||
}
|
||||
|
||||
TextBounds textBounds = font.getMultiLineBounds(text);
|
||||
layout.setText(font, text);
|
||||
TextBounds textBounds = new TextBounds(layout.width, layout.height);
|
||||
|
||||
float textHeight = textBounds.height;
|
||||
if (h > textHeight) {
|
||||
@@ -602,7 +610,7 @@ public class CardRenderer {
|
||||
}
|
||||
|
||||
font.setColor(color);
|
||||
font.drawMultiLine(g.getBatch(), text, g.adjustX(x), g.adjustY(y, 0), w, horizontalAlignment);
|
||||
font.draw(g.getBatch(), text, g.adjustX(x), g.adjustY(y, 0), w, horizontalAlignment, true);
|
||||
|
||||
if (color.a < 1) {
|
||||
Gdx.gl.glDisable(GL_BLEND);
|
||||
@@ -685,7 +693,7 @@ public class CardRenderer {
|
||||
|
||||
//draw card damage above P/T box if needed
|
||||
if (card.getDamage() > 0) {
|
||||
g.drawOutlinedText(">" + card.getDamage() + "<", font, Color.RED, Color.WHITE, x, y - h + padding, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawOutlinedText(">" + card.getDamage() + "<", font, Color.RED, Color.WHITE, x, y - h + padding, w, h, false, Align.center, true);
|
||||
}
|
||||
|
||||
g.fillRect(color, x, y, w, h);
|
||||
@@ -693,7 +701,7 @@ public class CardRenderer {
|
||||
|
||||
x += padding;
|
||||
for (int i = 0; i < pieces.size(); i++) {
|
||||
g.drawText(pieces.get(i), font, Color.BLACK, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(pieces.get(i), font, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
x += pieceWidths.get(i);
|
||||
}
|
||||
}
|
||||
@@ -771,7 +779,8 @@ public class CardRenderer {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
TextureRegion[] textureRegions = new TextureRegion[pages.size];
|
||||
//TextureRegion[] textureRegions = new TextureRegion[pages.size];
|
||||
Array<TextureRegion> textureRegions = new Array<>();
|
||||
for (int i = 0; i < pages.size; i++) {
|
||||
PixmapPacker.Page p = pages.get(i);
|
||||
Texture texture = new Texture(new PixmapTextureData(p.getPixmap(), p.getPixmap().getFormat(), false, false)) {
|
||||
@@ -782,7 +791,8 @@ public class CardRenderer {
|
||||
}
|
||||
};
|
||||
texture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
|
||||
textureRegions[i] = new TextureRegion(texture);
|
||||
//textureRegions[i] = new TextureRegion(texture);
|
||||
textureRegions.add(new TextureRegion(texture));
|
||||
}
|
||||
|
||||
counterFonts.put(fontSize, new BitmapFont(fontData, textureRegions, true));
|
||||
|
||||
@@ -5,8 +5,8 @@ import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -281,10 +281,10 @@ public class CardZoom extends FOverlay {
|
||||
|
||||
if (currentActivateAction != null) {
|
||||
g.fillRect(FDialog.MSG_BACK_COLOR, 0, 0, w, messageHeight);
|
||||
g.drawText("Swipe up to " + currentActivateAction, FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, 0, w, messageHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText("Swipe up to " + currentActivateAction, FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, 0, w, messageHeight, false, Align.center, true);
|
||||
}
|
||||
g.fillRect(FDialog.MSG_BACK_COLOR, 0, h - messageHeight, w, messageHeight);
|
||||
g.drawText("Swipe down to switch to " + (zoomMode ? "detail" : "picture") + " view", FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, h - messageHeight, w, messageHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText("Swipe down to switch to " + (zoomMode ? "detail" : "picture") + " view", FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, h - messageHeight, w, messageHeight, false, Align.center, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ import forge.toolbox.FTextArea;
|
||||
import forge.util.Callback;
|
||||
import forge.util.Utils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class AddBasicLandsDialog extends FDialog {
|
||||
callback = callback0;
|
||||
currentDeck = deck;
|
||||
|
||||
lblDeckInfo.setAlignment(HAlignment.CENTER);
|
||||
lblDeckInfo.setAlignment(Align.center);
|
||||
lblDeckInfo.setFont(FSkinFont.get(12));
|
||||
|
||||
cbLandSet.setFont(lblLandSet.getFont());
|
||||
@@ -322,7 +322,7 @@ public class AddBasicLandsDialog extends FDialog {
|
||||
card = generateCard(artIndex); //generate card for display
|
||||
}
|
||||
});
|
||||
lblCount = add(new FLabel.Builder().text("0").font(FSkinFont.get(18)).align(HAlignment.CENTER).build());
|
||||
lblCount = add(new FLabel.Builder().text("0").font(FSkinFont.get(18)).align(Align.center).build());
|
||||
btnSubtract = add(new FLabel.ButtonBuilder().icon(FSkinImage.MINUS).command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
|
||||
@@ -41,7 +41,7 @@ import forge.util.storage.IStorage;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -524,7 +524,7 @@ public class FDeckChooser extends FScreen {
|
||||
cmbDeckTypes.addItem(DeckType.RANDOM_DECK);
|
||||
break;
|
||||
}
|
||||
cmbDeckTypes.setAlignment(HAlignment.CENTER);
|
||||
cmbDeckTypes.setAlignment(Align.center);
|
||||
restoreSavedState();
|
||||
cmbDeckTypes.setChangedHandler(new FEventHandler() {
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package forge.deck;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.base.Supplier;
|
||||
@@ -239,8 +239,8 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
|
||||
protected final DeckHeader deckHeader = add(new DeckHeader());
|
||||
protected final FLabel lblName = deckHeader.add(new FLabel.Builder().font(FSkinFont.get(16)).insets(new Vector2(Utils.scale(5), 0)).build());
|
||||
private final FLabel btnSave = deckHeader.add(new FLabel.Builder().icon(FSkinImage.SAVE).align(HAlignment.CENTER).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
||||
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(HAlignment.CENTER).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
||||
private final FLabel btnSave = deckHeader.add(new FLabel.Builder().icon(FSkinImage.SAVE).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
||||
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
||||
|
||||
public FDeckEditor(EditorType editorType0, DeckProxy editDeck, boolean showMainDeck) {
|
||||
this(editorType0, editDeck.getName(), editDeck.getPath(), null, showMainDeck);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package forge.error;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -15,6 +13,7 @@ import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.toolbox.FTextArea;
|
||||
import forge.util.Callback;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class BugReportDialog extends FScreen { //use screen rather than dialog so screen with bug isn't rendered
|
||||
@@ -148,7 +147,7 @@ public class BugReportDialog extends FScreen { //use screen rather than dialog s
|
||||
@Override
|
||||
public void drawBackground(Graphics g) {
|
||||
g.fillRect(BACK_COLOR, 0, 0, getWidth(), getHeight());
|
||||
g.drawText(text, FONT, FORE_COLOR, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, false, HAlignment.LEFT, false);
|
||||
g.drawText(text, FONT, FORE_COLOR, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, false, Align.left, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ import forge.toolbox.FList;
|
||||
import forge.toolbox.FList.CompactModeHandler;
|
||||
import forge.util.Utils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@@ -118,7 +118,7 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
|
||||
if (DeckManager.this.getConfig().getCols().size() == 1) {
|
||||
//if just string column, just draw deck string value
|
||||
g.drawText(deck.toString(), font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(deck.toString(), font, foreColor, x, y, w, h, false, Align.left, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
if (!deck.getPath().isEmpty()) { //render path after name if needed
|
||||
name += " (" + deck.getPath().substring(1) + ")";
|
||||
}
|
||||
g.drawText(name, font, foreColor, x, y, availableNameWidth, IMAGE_SIZE, false, HAlignment.LEFT, true);
|
||||
g.drawText(name, font, foreColor, x, y, availableNameWidth, IMAGE_SIZE, false, Align.left, true);
|
||||
x += availableNameWidth + FList.PADDING;
|
||||
CardFaceSymbols.drawColorSet(g, deckColor, x, y, IMAGE_SIZE);
|
||||
|
||||
@@ -158,7 +158,7 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
sideSize = 0; //show sideboard as 0 if empty
|
||||
}
|
||||
|
||||
g.drawText(deck.getFormatsString() + " (" + mainSize + " / " + sideSize + ")", font, foreColor, x, y, availableFormatWidth, lineHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(deck.getFormatsString() + " (" + mainSize + " / " + sideSize + ")", font, foreColor, x, y, availableFormatWidth, lineHeight, false, Align.left, true);
|
||||
|
||||
x += availableFormatWidth + CardRenderer.SET_BOX_MARGIN;
|
||||
y -= CardRenderer.SET_BOX_MARGIN;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
package forge.itemmanager;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
@@ -83,7 +83,7 @@ public abstract class ItemManager<T extends InventoryItem> extends FContainer im
|
||||
private final FLabel btnView = new FLabel.ButtonBuilder()
|
||||
.iconScaleFactor(0.9f).build(); //icon set later
|
||||
private final FLabel btnAdvancedSearchOptions = new FLabel.Builder()
|
||||
.selectable(true).align(HAlignment.CENTER)
|
||||
.selectable(true).align(Align.center)
|
||||
.icon(FSkinImage.SETTINGS).iconScaleFactor(0.9f)
|
||||
.build();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.itemmanager;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import forge.Graphics;
|
||||
@@ -67,7 +67,7 @@ public class SpellShopManager extends ItemManager<InventoryItem> {
|
||||
CardRenderer.drawCardListItem(g, font, foreColor, (PaperCard)value.getKey(), value.getValue(), getItemSuffix(value), x, y, w, h, compactModeHandler.isCompactMode());
|
||||
}
|
||||
else {
|
||||
g.drawText(value.getValue().toString() + " " + value.getKey().toString(), font, foreColor, x + cardArtWidth, y, w - cardArtWidth, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(value.getValue().toString() + " " + value.getKey().toString(), font, foreColor, x + cardArtWidth, y, w - cardArtWidth, h, false, Align.left, true);
|
||||
Texture image = ImageCache.getImage(value.getKey());
|
||||
if (image != null) {
|
||||
float imageRatio = (float)image.getWidth() / (float)image.getHeight();
|
||||
@@ -87,7 +87,7 @@ public class SpellShopManager extends ItemManager<InventoryItem> {
|
||||
g.fillRect(backColor, x - FList.PADDING, y, cardArtWidth, priceHeight);
|
||||
g.drawImage(FSkinImage.QUEST_COINSTACK, x, y, priceHeight, priceHeight);
|
||||
float offset = priceHeight * 1.1f;
|
||||
g.drawText(fnGetPrice.apply(value).toString(), font, foreColor, x + offset, y, cardArtWidth - offset - 2 * FList.PADDING, priceHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(fnGetPrice.apply(value).toString(), font, foreColor, x + offset, y, cardArtWidth - offset - 2 * FList.PADDING, priceHeight, false, Align.left, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.itemmanager.filters;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
@@ -97,7 +97,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
private String toolTipText;
|
||||
|
||||
private FiltersLabel() {
|
||||
super(new FLabel.Builder().align(HAlignment.LEFT).parseSymbols(true).font(ListLabelFilter.LABEL_FONT));
|
||||
super(new FLabel.Builder().align(Align.left).parseSymbols(true).font(ListLabelFilter.LABEL_FONT));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,12 +231,12 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
private AdvancedSearch.Filter<T> filter;
|
||||
|
||||
private Filter() {
|
||||
btnNotBeforeParen = add(new FLabel.Builder().align(HAlignment.CENTER).text("NOT").selectable().build());
|
||||
btnOpenParen = add(new FLabel.Builder().align(HAlignment.CENTER).text("(").selectable().build());
|
||||
btnNotAfterParen = add(new FLabel.Builder().align(HAlignment.CENTER).text("NOT").selectable().build());
|
||||
btnNotBeforeParen = add(new FLabel.Builder().align(Align.center).text("NOT").selectable().build());
|
||||
btnOpenParen = add(new FLabel.Builder().align(Align.center).text("(").selectable().build());
|
||||
btnNotAfterParen = add(new FLabel.Builder().align(Align.center).text("NOT").selectable().build());
|
||||
btnFilter = add(new FLabel.ButtonBuilder().parseSymbols(true).build());
|
||||
btnCloseParen = add(new FLabel.Builder().align(HAlignment.CENTER).selectable().text(")").build());
|
||||
btnAnd = add(new FLabel.Builder().align(HAlignment.CENTER).text("AND").selectable().command(new FEventHandler() {
|
||||
btnCloseParen = add(new FLabel.Builder().align(Align.center).selectable().text(")").build());
|
||||
btnAnd = add(new FLabel.Builder().align(Align.center).text("AND").selectable().command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
if (btnAnd.isSelected()) {
|
||||
@@ -248,7 +248,7 @@ public class AdvancedSearchFilter<T extends InventoryItem> extends ItemFilter<T>
|
||||
}
|
||||
}
|
||||
}).build());
|
||||
btnOr = add(new FLabel.Builder().align(HAlignment.CENTER).text("OR").selectable().command(new FEventHandler() {
|
||||
btnOr = add(new FLabel.Builder().align(Align.center).text("OR").selectable().command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
if (btnOr.isSelected()) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import forge.util.Utils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
|
||||
public abstract class FormatFilter<T extends InventoryItem> extends ItemFilter<T> {
|
||||
@@ -231,7 +231,7 @@ public abstract class FormatFilter<T extends InventoryItem> extends ItemFilter<T
|
||||
float textHeight = h;
|
||||
h *= 0.66f;
|
||||
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w - h - FList.PADDING, textHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w - h - FList.PADDING, textHeight, false, Align.left, true);
|
||||
|
||||
x += w - h;
|
||||
y += (textHeight - h) / 2;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.itemmanager.filters;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -132,7 +132,7 @@ public class HistoricFormatSelect extends FScreen {
|
||||
float textHeight = h;
|
||||
h *= 0.66f;
|
||||
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w - h - FList.PADDING, textHeight, false, BitmapFont.HAlignment.LEFT, true);
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w - h - FList.PADDING, textHeight, false, Align.left, true);
|
||||
|
||||
x += w - h;
|
||||
y += (textHeight - h) / 2;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package forge.itemmanager.filters;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.item.InventoryItem;
|
||||
import forge.itemmanager.ItemManager;
|
||||
@@ -60,7 +59,7 @@ public abstract class ListLabelFilter<T extends InventoryItem> extends ItemFilte
|
||||
|
||||
private class ListLabel extends FLabel {
|
||||
private ListLabel() {
|
||||
super(new FLabel.Builder().align(HAlignment.LEFT).font(LABEL_FONT));
|
||||
super(new FLabel.Builder().align(Align.left).font(LABEL_FONT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.itemmanager.filters;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class TextSearchFilter<T extends InventoryItem> extends ItemFilter<T> {
|
||||
@Override
|
||||
public void draw(Graphics g) {
|
||||
super.draw(g);
|
||||
g.drawText(ratio, renderedFont, GHOST_TEXT_COLOR, 0, 0, getWidth() - PADDING, getHeight(), false, HAlignment.RIGHT, true);
|
||||
g.drawText(ratio, renderedFont, GHOST_TEXT_COLOR, 0, 0, getWidth() - PADDING, getHeight(), false, Align.right, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.itemmanager.filters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.assets.FImage;
|
||||
import forge.item.InventoryItem;
|
||||
@@ -70,7 +70,7 @@ public abstract class ToggleButtonsFilter<T extends InventoryItem> extends ItemF
|
||||
private ToggleButton(FImage icon) {
|
||||
super(new FLabel.Builder()
|
||||
.icon(icon).iconScaleFactor(1f)
|
||||
.align(HAlignment.CENTER)
|
||||
.align(Align.center)
|
||||
.selectable(true).selected(true)
|
||||
.command(new FEventHandler() {
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.itemmanager.filters;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import forge.card.CardRules;
|
||||
@@ -55,7 +55,7 @@ public abstract class ValueRangeFilter<T extends InventoryItem> extends ItemFilt
|
||||
lowerBound = addSpinner(widget, true);
|
||||
|
||||
String text = "<= " + this.getCaption() + " <=";
|
||||
label = new FLabel.Builder().text(text).align(HAlignment.CENTER).font(ListLabelFilter.LABEL_FONT).build();
|
||||
label = new FLabel.Builder().text(text).align(Align.center).font(ListLabelFilter.LABEL_FONT).build();
|
||||
widget.add(label);
|
||||
|
||||
upperBound = addSpinner(widget, false);
|
||||
|
||||
@@ -37,9 +37,9 @@ import java.util.Map.Entry;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
private static final float PADDING = Utils.scale(5);
|
||||
@@ -789,7 +789,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
float x = GROUP_HEADER_GLYPH_WIDTH + PADDING + 1;
|
||||
float y = 0;
|
||||
String caption = name + " (" + items.size() + ")";
|
||||
g.drawText(caption, GROUP_HEADER_FONT, GROUP_HEADER_FORE_COLOR, x, y, getWidth(), GROUP_HEADER_HEIGHT, false, HAlignment.LEFT, true);
|
||||
g.drawText(caption, GROUP_HEADER_FONT, GROUP_HEADER_FORE_COLOR, x, y, getWidth(), GROUP_HEADER_HEIGHT, false, Align.left, true);
|
||||
x += GROUP_HEADER_FONT.getBounds(caption).width + PADDING;
|
||||
y += GROUP_HEADER_HEIGHT / 2;
|
||||
g.drawLine(GROUP_HEADER_LINE_THICKNESS, GROUP_HEADER_LINE_COLOR, x, y, getWidth(), y);
|
||||
@@ -963,7 +963,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
}
|
||||
else {
|
||||
g.fillRect(Color.BLACK, x, y, w, h);
|
||||
g.drawText(item.getName(), GROUP_HEADER_FONT, Color.WHITE, x + PADDING, y + PADDING, w - 2 * PADDING, h - 2 * PADDING, true, HAlignment.CENTER, false);
|
||||
g.drawText(item.getName(), GROUP_HEADER_FONT, Color.WHITE, x + PADDING, y + PADDING, w - 2 * PADDING, h - 2 * PADDING, true, Align.center, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package forge.menu;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.assets.TextRenderer;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class FMagnifyView extends FDropDown {
|
||||
@@ -66,6 +65,6 @@ public class FMagnifyView extends FDropDown {
|
||||
public void drawBackground(Graphics g) {
|
||||
super.drawBackground(g);
|
||||
g.fillRect(backColor, 0, 0, getWidth(), getHeight());
|
||||
renderer.drawText(g, text, font, foreColor, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, 0, getHeight(), true, HAlignment.LEFT, false);
|
||||
renderer.drawText(g, text, font, foreColor, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, 0, getHeight(), true, Align.left, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.menu;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Timer;
|
||||
import com.badlogic.gdx.utils.Timer.Task;
|
||||
|
||||
@@ -135,10 +135,10 @@ public class FMenuItem extends FDisplayObject implements IButton {
|
||||
}
|
||||
|
||||
if (textRenderer == null) {
|
||||
g.drawText(text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, false, Align.left, true);
|
||||
}
|
||||
else {
|
||||
textRenderer.drawText(g, text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, 0, h, false, HAlignment.LEFT, true);
|
||||
textRenderer.drawText(g, text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, 0, h, false, Align.left, true);
|
||||
}
|
||||
|
||||
//draw separator line
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.menu;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -99,6 +99,6 @@ public class FMenuTab extends FDisplayObject {
|
||||
y = PADDING;
|
||||
w = getWidth() - 2 * PADDING;
|
||||
h = getHeight() - 2 * PADDING;
|
||||
g.drawText(text, FONT, foreColor, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(text, FONT, foreColor, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package forge.menu;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -10,6 +8,7 @@ import forge.assets.FSkinFont;
|
||||
import forge.assets.FSkinColor.Colors;
|
||||
import forge.screens.FScreen;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class FTooltip extends FDropDown {
|
||||
@@ -68,6 +67,6 @@ public class FTooltip extends FDropDown {
|
||||
@Override
|
||||
public void drawBackground(Graphics g) {
|
||||
super.drawBackground(g);
|
||||
g.drawText(text, FONT, FORE_COLOR, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, true, HAlignment.LEFT, false);
|
||||
g.drawText(text, FONT, FORE_COLOR, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, true, Align.left, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package forge.screens;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -197,13 +197,13 @@ public abstract class FScreen extends FContainer {
|
||||
protected final FLabel btnBack, lblCaption;
|
||||
|
||||
public DefaultHeader(String headerCaption) {
|
||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(HAlignment.CENTER).command(new FEventHandler() {
|
||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
Forge.back();
|
||||
}
|
||||
}).build());
|
||||
lblCaption = add(new FLabel.Builder().text(headerCaption).font(FONT).align(HAlignment.CENTER).build());
|
||||
lblCaption = add(new FLabel.Builder().text(headerCaption).font(FONT).align(Align.center).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -245,7 +245,7 @@ public abstract class FScreen extends FContainer {
|
||||
public MenuHeader(String headerCaption, FPopupMenu menu0) {
|
||||
super(headerCaption);
|
||||
menu = menu0;
|
||||
btnMenu = add(new FLabel.Builder().icon(new MenuIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(HAlignment.CENTER).command(new FEventHandler() {
|
||||
btnMenu = add(new FLabel.Builder().icon(new MenuIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
menu.show(btnMenu, 0, HEIGHT);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
@@ -95,6 +95,6 @@ public class LoadingOverlay extends FOverlay {
|
||||
y += padding;
|
||||
g.drawImage(FSkinImage.LOGO, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
|
||||
y += logoSize + padding;
|
||||
g.drawText(caption, FONT, FORE_COLOR, x, y, panelWidth, getHeight(), false, HAlignment.CENTER, false);
|
||||
g.drawText(caption, FONT, FORE_COLOR, x, y, panelWidth, getHeight(), false, Align.center, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.screens;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -94,7 +94,7 @@ public class SplashScreen extends FContainer {
|
||||
String disclaimer = "Forge is not affiliated in any way with Wizards of the Coast.\n"
|
||||
+ "Forge is open source software, released under the GNU Public License.";
|
||||
g.drawText(disclaimer, disclaimerFont, FProgressBar.SEL_FORE_COLOR,
|
||||
x, y, w, disclaimerHeight, true, HAlignment.CENTER, true);
|
||||
x, y, w, disclaimerHeight, true, Align.center, true);
|
||||
|
||||
float padding = 20f / 450f * w;
|
||||
float pbHeight = 57f / 450f * h;
|
||||
@@ -103,6 +103,6 @@ public class SplashScreen extends FContainer {
|
||||
g.draw(progressBar);
|
||||
|
||||
String version = "v. " + Forge.CURRENT_VERSION + " (Alpha)";
|
||||
g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(version, disclaimerFont, FProgressBar.SEL_FORE_COLOR, x, getHeight() - disclaimerHeight, w, disclaimerHeight, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -183,7 +183,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
||||
public TabHeader(TabPage<T>[] tabPages0, boolean showBackButton) {
|
||||
tabPages = tabPages0;
|
||||
if (showBackButton) {
|
||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(BTN_PRESSED_COLOR).align(HAlignment.CENTER).command(new FEventHandler() {
|
||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
Forge.back();
|
||||
@@ -365,7 +365,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
||||
if (parentScreen.showCompactTabs() && !isLandscapeMode) {
|
||||
h -= 2 * padding;
|
||||
if (icon == null) {
|
||||
g.drawText(caption, TAB_FONT, TAB_FORE_COLOR, padding, padding, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(caption, TAB_FONT, TAB_FORE_COLOR, padding, padding, w, h, false, Align.center, true);
|
||||
}
|
||||
else {
|
||||
//center combination of icon and text
|
||||
@@ -393,13 +393,13 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
||||
x += iconOffset;
|
||||
w -= iconOffset;
|
||||
g.startClip(x, y, w, h);
|
||||
g.drawText(caption, font, TAB_FORE_COLOR, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(caption, font, TAB_FORE_COLOR, x, y, w, h, false, Align.left, true);
|
||||
g.endClip();
|
||||
}
|
||||
}
|
||||
else {
|
||||
float y = h - padding - TAB_FONT.getCapHeight();
|
||||
g.drawText(caption, TAB_FONT, TAB_FORE_COLOR, padding, y - padding, w, h - y + padding, false, HAlignment.CENTER, true);
|
||||
g.drawText(caption, TAB_FONT, TAB_FORE_COLOR, padding, y - padding, w, h - y + padding, false, Align.center, true);
|
||||
|
||||
if (icon != null) {
|
||||
float iconHeight = y - 2 * padding;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package forge.screens.achievements;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -54,7 +54,7 @@ public class AchievementsScreen extends FScreen {
|
||||
AchievementCollection.buildComboBox(cbCollections);
|
||||
|
||||
cbCollections.setSelectedIndex(0);
|
||||
cbCollections.setAlignment(HAlignment.CENTER);
|
||||
cbCollections.setAlignment(Align.center);
|
||||
cbCollections.setChangedHandler(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
@@ -271,11 +271,11 @@ public class AchievementsScreen extends FScreen {
|
||||
if (plateY + plateHeight > 0) {
|
||||
g.drawImage((FImage)achievement.getImage(), x + trophyOffset, y, trophyImageWidth, trophyHeight);
|
||||
g.drawImage(FSkinImage.TROPHY_PLATE, x + plateOffset, plateY, plateWidth, plateHeight);
|
||||
g.drawText(achievement.getDisplayName(), titleFont, FORE_COLOR, x + plateOffset + plateWidth * 0.075f, plateY + plateHeight * 0.05f, plateWidth * 0.85f, titleHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(achievement.getDisplayName(), titleFont, FORE_COLOR, x + plateOffset + plateWidth * 0.075f, plateY + plateHeight * 0.05f, plateWidth * 0.85f, titleHeight, false, Align.center, true);
|
||||
|
||||
String subTitle = achievement.getSubTitle(false);
|
||||
if (subTitle != null) {
|
||||
g.drawText(subTitle, subTitleFont, FORE_COLOR, x + plateOffset + plateWidth * 0.075f, plateY + plateHeight * 0.6f, plateWidth * 0.85f, subTitleHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(subTitle, subTitleFont, FORE_COLOR, x + plateOffset + plateWidth * 0.075f, plateY + plateHeight * 0.6f, plateWidth * 0.85f, subTitleHeight, false, Align.center, true);
|
||||
}
|
||||
|
||||
if (achievement == selectedAchievement) {
|
||||
@@ -338,40 +338,40 @@ public class AchievementsScreen extends FScreen {
|
||||
y += PADDING;
|
||||
w -= 2 * PADDING;
|
||||
h -= 2 * PADDING;
|
||||
g.drawText(selectedAchievement.getDisplayName(), NAME_FONT, TEXT_COLOR, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(selectedAchievement.getDisplayName(), NAME_FONT, TEXT_COLOR, x, y, w, h, false, Align.left, false);
|
||||
y += NAME_FONT.getLineHeight();
|
||||
if (subTitle != null) {
|
||||
g.drawText(subTitle, DESC_FONT, TEXT_COLOR, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(subTitle, DESC_FONT, TEXT_COLOR, x, y, w, h, false, Align.left, false);
|
||||
y += DESC_FONT.getLineHeight();
|
||||
}
|
||||
y += PADDING;
|
||||
if (sharedDesc != null) {
|
||||
g.drawText(selectedAchievement.isSpecial() ? sharedDesc : sharedDesc + "...", DESC_FONT, TEXT_COLOR,
|
||||
x, y, w, h, false, HAlignment.LEFT, false);
|
||||
x, y, w, h, false, Align.left, false);
|
||||
y += DESC_FONT.getLineHeight();
|
||||
}
|
||||
if (mythicDesc != null) {
|
||||
g.drawText(selectedAchievement.isSpecial() ? mythicDesc : "(Mythic) " + mythicDesc, DESC_FONT, //handle flavor text here too
|
||||
selectedAchievement.earnedMythic() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
||||
x, y, w, h, false, HAlignment.LEFT, false);
|
||||
x, y, w, h, false, Align.left, false);
|
||||
y += DESC_FONT.getLineHeight();
|
||||
}
|
||||
if (rareDesc != null) {
|
||||
g.drawText("(Rare) " + rareDesc, DESC_FONT,
|
||||
selectedAchievement.earnedRare() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
||||
x, y, w, h, false, HAlignment.LEFT, false);
|
||||
x, y, w, h, false, Align.left, false);
|
||||
y += DESC_FONT.getLineHeight();
|
||||
}
|
||||
if (uncommonDesc != null) {
|
||||
g.drawText("(Uncommon) " + uncommonDesc, DESC_FONT,
|
||||
selectedAchievement.earnedUncommon() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
||||
x, y, w, h, false, HAlignment.LEFT, false);
|
||||
x, y, w, h, false, Align.left, false);
|
||||
y += DESC_FONT.getLineHeight();
|
||||
}
|
||||
if (commonDesc != null) {
|
||||
g.drawText("(Common) " + commonDesc, DESC_FONT,
|
||||
selectedAchievement.earnedCommon() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
||||
x, y, w, h, false, HAlignment.LEFT, false);
|
||||
x, y, w, h, false, Align.left, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
public class AvatarSelector extends FScreen {
|
||||
public static int getRandomAvatar(List<Integer> usedAvatars) {
|
||||
@@ -87,7 +87,7 @@ public class AvatarSelector extends FScreen {
|
||||
}
|
||||
|
||||
private void addAvatarLabel(final FImage img, final int index) {
|
||||
final FLabel lbl = new FLabel.Builder().icon(img).iconScaleFactor(0.95f).align(HAlignment.CENTER)
|
||||
final FLabel lbl = new FLabel.Builder().icon(img).iconScaleFactor(0.95f).align(Align.center)
|
||||
.iconInBackground(true).selectable(true).selected(currentIndex == index)
|
||||
.build();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import forge.deck.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.FThreads;
|
||||
@@ -413,10 +413,10 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
float totalHeight = h;
|
||||
h = font.getMultiLineBounds(text).height + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(text, font, foreColor, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(text, font, foreColor, x, y, w, h, false, Align.left, false);
|
||||
value.draw(g, font, foreColor, x, y, w, h);
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(value.gameType.getDescription(), SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, HAlignment.LEFT, false);
|
||||
g.drawText(value.gameType.getDescription(), SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
@@ -835,7 +834,7 @@ public class PlayerPanel extends FContainer {
|
||||
|
||||
/** Adds a pre-styled FLabel component with the specified title. */
|
||||
private FLabel newLabel(String title) {
|
||||
return new FLabel.Builder().text(title).font(LABEL_FONT).align(HAlignment.RIGHT).build();
|
||||
return new FLabel.Builder().text(title).font(LABEL_FONT).align(Align.right).build();
|
||||
}
|
||||
|
||||
private static final ImmutableList<String> genderOptions = ImmutableList.of("Male", "Female", "Any");
|
||||
|
||||
@@ -6,8 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Graphics;
|
||||
@@ -253,8 +252,8 @@ public class LoadGauntletScreen extends LaunchScreen {
|
||||
String progress = completed + " / " + opponents + " (" + percent.format((double)completed / (double)opponents) + ")";
|
||||
float progressWidth = font.getBounds(progress).width + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(name, font, foreColor, x, y, w - progressWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(progress, font, foreColor, x, y, w, h, false, HAlignment.RIGHT, false);
|
||||
g.drawText(name, font, foreColor, x, y, w - progressWidth, h, false, Align.left, false);
|
||||
g.drawText(progress, font, foreColor, x, y, w, h, false, Align.right, false);
|
||||
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
y += h;
|
||||
@@ -263,8 +262,8 @@ public class LoadGauntletScreen extends LaunchScreen {
|
||||
String timestamp = value.getTimestamp();
|
||||
font = FSkinFont.get(12);
|
||||
float timestampWidth = font.getBounds(timestamp).width + SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(value.getUserDeck() == null ? "(none)" : value.getUserDeck().getName(), font, SettingsScreen.DESC_COLOR, x, y, w - timestampWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(timestamp, font, SettingsScreen.DESC_COLOR, x + w - timestampWidth + SettingsScreen.SETTING_PADDING, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(value.getUserDeck() == null ? "(none)" : value.getUserDeck().getName(), font, SettingsScreen.DESC_COLOR, x, y, w - timestampWidth, h, false, Align.left, false);
|
||||
g.drawText(timestamp, font, SettingsScreen.DESC_COLOR, x + w - timestampWidth + SettingsScreen.SETTING_PADDING, y, w, h, false, Align.left, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.screens.home;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -247,7 +247,7 @@ public class HomeScreen extends FScreen {
|
||||
public void draw(Graphics g) {
|
||||
if (Forge.isLandscapeMode()) {
|
||||
//draw text only for Landscape mode
|
||||
g.drawText(getText(), getFont(), getForeColor(), 0, 0, getWidth(), getHeight(), false, HAlignment.LEFT, true);
|
||||
g.drawText(getText(), getFont(), getForeColor(), 0, 0, getWidth(), getHeight(), false, Align.left, true);
|
||||
}
|
||||
else { //draw buttons normally for portrait mode
|
||||
super.draw(g);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.limited;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
@@ -39,7 +39,7 @@ public class LoadDraftScreen extends LaunchScreen {
|
||||
private final FLabel lblTip = add(new FLabel.Builder()
|
||||
.text("Double-tap to edit deck (Long-press to view)")
|
||||
.textColor(FLabel.INLINE_LABEL_COLOR)
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(12)).build());
|
||||
.align(Align.center).font(FSkinFont.get(12)).build());
|
||||
|
||||
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
||||
private final FLabel lblMode = add(new FLabel.Builder().text("Mode:").font(GAME_MODE_FONT).build());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.limited;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.FThreads;
|
||||
|
||||
import forge.Forge;
|
||||
@@ -39,7 +39,7 @@ public class LoadSealedScreen extends LaunchScreen {
|
||||
private final FLabel lblTip = add(new FLabel.Builder()
|
||||
.text("Double-tap to edit deck (Long-press to view)")
|
||||
.textColor(FLabel.INLINE_LABEL_COLOR)
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(12)).build());
|
||||
.align(Align.center).font(FSkinFont.get(12)).build());
|
||||
|
||||
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
||||
private final FLabel lblMode = add(new FLabel.Builder().text("Mode:").font(GAME_MODE_FONT).build());
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
public class VAssignDamage extends FDialog {
|
||||
private static final float CARD_GAP_X = Utils.scale(10);
|
||||
@@ -64,8 +64,8 @@ public class VAssignDamage extends FDialog {
|
||||
|
||||
private final GameEntityView defender;
|
||||
|
||||
private final FLabel lblTotalDamage = add(new FLabel.Builder().text("Available damage points: Unknown").align(HAlignment.CENTER).build());
|
||||
private final FLabel lblAssignRemaining = add(new FLabel.Builder().text("Distribute the remaining damage points among lethally wounded entities").align(HAlignment.CENTER).build());
|
||||
private final FLabel lblTotalDamage = add(new FLabel.Builder().text("Available damage points: Unknown").align(Align.center).build());
|
||||
private final FLabel lblAssignRemaining = add(new FLabel.Builder().text("Distribute the remaining damage points among lethally wounded entities").align(Align.center).build());
|
||||
|
||||
private final AttDefCardPanel pnlAttacker;
|
||||
private final DefendersPanel pnlDefenders;
|
||||
@@ -215,7 +215,7 @@ public class VAssignDamage extends FDialog {
|
||||
else {
|
||||
obj = add(new MiscAttDefPanel(defender.toString(), FSkinImage.UNKNOWN));
|
||||
}
|
||||
label = add(new FLabel.Builder().text("0").font(FSkinFont.get(18)).align(HAlignment.CENTER).build());
|
||||
label = add(new FLabel.Builder().text("0").font(FSkinFont.get(18)).align(Align.center).build());
|
||||
btnSubtract = add(new FLabel.ButtonBuilder().icon(FSkinImage.MINUS).command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
@@ -284,7 +284,7 @@ public class VAssignDamage extends FDialog {
|
||||
float w = getWidth();
|
||||
float h = getHeight();
|
||||
g.drawImage(image, 0, 0, w, w);
|
||||
g.drawText(name, FONT, FORE_COLOR, 0, w, w, h - w, false, HAlignment.CENTER, true);
|
||||
g.drawText(name, FONT, FORE_COLOR, 0, w, w, h - w, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package forge.screens.match.views;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import forge.screens.match.MatchController;
|
||||
import forge.toolbox.FCheckBox;
|
||||
import forge.toolbox.FChoiceList;
|
||||
@@ -12,6 +10,7 @@ import forge.toolbox.FDialog;
|
||||
import forge.toolbox.FEvent;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.util.TextBounds;
|
||||
|
||||
public class VAutoYields extends FDialog {
|
||||
private final FChoiceList<String> lstAutoYields;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package forge.screens.match.views;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FImage;
|
||||
@@ -70,7 +70,7 @@ public class VAvatar extends FDisplayObject {
|
||||
//use font and padding from phase indicator so text lines up
|
||||
FSkinFont font = VPhaseIndicator.BASE_FONT;
|
||||
float xpHeight = font.getCapHeight();
|
||||
g.drawOutlinedText(xp + " XP", font, Color.WHITE, Color.BLACK, 0, h - xpHeight - VPhaseIndicator.PADDING_Y, w - VPhaseIndicator.PADDING_X, h, false, HAlignment.RIGHT, false);
|
||||
g.drawOutlinedText(xp + " XP", font, Color.WHITE, Color.BLACK, 0, h - xpHeight - VPhaseIndicator.PADDING_Y, w - VPhaseIndicator.PADDING_X, h, false, Align.right, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.screens.match.views;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -108,7 +108,7 @@ public class VLog extends FDropDown {
|
||||
}
|
||||
|
||||
//use full height without padding so text not scaled down
|
||||
renderer.drawText(g, text, FONT, FORE_COLOR, PADDING, PADDING, w - 2 * PADDING, h, 0, h, true, HAlignment.LEFT, false);
|
||||
renderer.drawText(g, text, FONT, FORE_COLOR, PADDING, PADDING, w - 2 * PADDING, h, 0, h, true, Align.left, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.screens.match.views;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -148,7 +148,7 @@ public class VManaPool extends VDisplayArea {
|
||||
w = getWidth();
|
||||
h = getHeight() - y;
|
||||
|
||||
g.drawText(text, FONT, FORE_COLOR, x, y, w, h, false, HAlignment.CENTER, false);
|
||||
g.drawText(text, FONT, FORE_COLOR, x, y, w, h, false, Align.center, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -14,6 +13,7 @@ import forge.assets.FSkinColor.Colors;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.toolbox.FContainer;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class VPhaseIndicator extends FContainer {
|
||||
@@ -160,7 +160,7 @@ public class VPhaseIndicator extends FContainer {
|
||||
backColor = FSkinColor.get(Colors.CLR_PHASE_INACTIVE_DISABLED);
|
||||
}
|
||||
g.fillRect(backColor, x, 0, w, h);
|
||||
g.drawText(caption, font, Color.BLACK, x, 0, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(caption, font, Color.BLACK, x, 0, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -392,21 +392,21 @@ public class VPlayerPanel extends FContainer {
|
||||
@Override
|
||||
public void draw(Graphics g) {
|
||||
if (poisonCounters == 0 && energyCounters == 0) {
|
||||
g.drawText(lifeStr, LIFE_FONT, INFO_FORE_COLOR, 0, 0, getWidth(), getHeight(), false, HAlignment.CENTER, true);
|
||||
g.drawText(lifeStr, LIFE_FONT, INFO_FORE_COLOR, 0, 0, getWidth(), getHeight(), false, Align.center, true);
|
||||
}
|
||||
else {
|
||||
float halfHeight = getHeight() / 2;
|
||||
float textStart = halfHeight + Utils.scale(1);
|
||||
float textWidth = getWidth() - textStart;
|
||||
g.drawImage(FSkinImage.QUEST_LIFE, 0, 0, halfHeight, halfHeight);
|
||||
g.drawText(lifeStr, INFO_FONT, INFO_FORE_COLOR, textStart, 0, textWidth, halfHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(lifeStr, INFO_FONT, INFO_FORE_COLOR, textStart, 0, textWidth, halfHeight, false, Align.center, true);
|
||||
if (poisonCounters > 0) { //prioritize showing poison counters over energy counters
|
||||
g.drawImage(FSkinImage.POISON, 0, halfHeight, halfHeight, halfHeight);
|
||||
g.drawText(String.valueOf(poisonCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(String.valueOf(poisonCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
||||
}
|
||||
else {
|
||||
g.drawImage(FSkinImage.ENERGY, 0, halfHeight, halfHeight, halfHeight);
|
||||
g.drawText(String.valueOf(energyCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(String.valueOf(energyCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,10 +510,10 @@ public class VPlayerPanel extends FContainer {
|
||||
}
|
||||
|
||||
x += w + INFO_TAB_PADDING_X;
|
||||
HAlignment alignX = HAlignment.LEFT;
|
||||
int alignX = Align.left;
|
||||
if (lblLife.getRotate180()) {
|
||||
g.startRotateTransform(x + (getWidth() - x + 1) / 2, getHeight() / 2, 180);
|
||||
alignX = HAlignment.RIGHT;
|
||||
alignX = Align.right;
|
||||
}
|
||||
g.drawText(value, INFO_FONT, INFO_FORE_COLOR, x, 0, getWidth() - x + 1, getHeight(), false, alignX, true);
|
||||
if (lblLife.getRotate180()) {
|
||||
@@ -535,7 +535,7 @@ public class VPlayerPanel extends FContainer {
|
||||
g.drawImage(icon, x, y, w, h);
|
||||
|
||||
y += h + INFO_TAB_PADDING_Y;
|
||||
g.drawText(value, INFO_FONT, INFO_FORE_COLOR, 0, y, getWidth(), getHeight() - y + 1, false, HAlignment.CENTER, false);
|
||||
g.drawText(value, INFO_FONT, INFO_FORE_COLOR, 0, y, getWidth(), getHeight() - y + 1, false, Align.center, false);
|
||||
if (lblLife.getRotate180()) {
|
||||
g.endTransform();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.match.views;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FImage;
|
||||
@@ -62,7 +62,7 @@ public class VPlayers extends FDropDown {
|
||||
g.drawImage(avatarImage, x, y, h, h);
|
||||
x += h + PADDING;
|
||||
|
||||
g.drawText(player.getDetails(), FONT, FList.FORE_COLOR, x, y, getWidth() - PADDING - x, h, true, HAlignment.LEFT, true);
|
||||
g.drawText(player.getDetails(), FONT, FList.FORE_COLOR, x, y, getWidth() - PADDING - x, h, true, Align.left, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,9 +2,7 @@ package forge.screens.match.views;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -18,6 +16,7 @@ import forge.toolbox.FButton.Corner;
|
||||
import forge.toolbox.FContainer;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class VPrompt extends FContainer {
|
||||
@@ -125,7 +124,7 @@ public class VPrompt extends FContainer {
|
||||
float y = PADDING;
|
||||
float w = getWidth() - 2 * PADDING;
|
||||
float h = getHeight() - 2 * PADDING;
|
||||
renderer.drawText(g, message, FONT, FORE_COLOR, x, y, w, h, y, h, true, HAlignment.CENTER, true);
|
||||
renderer.drawText(g, message, FONT, FORE_COLOR, x, y, w, h, y, h, true, Align.center, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -133,7 +133,7 @@ public class VStack extends FDropDown {
|
||||
|
||||
final FCollectionView<StackItemView> stack = MatchController.instance.getGameView().getStack();
|
||||
if (stack.isEmpty()) { //show label if stack empty
|
||||
FLabel label = add(new FLabel.Builder().text("[Empty]").font(FONT).align(HAlignment.CENTER).build());
|
||||
FLabel label = add(new FLabel.Builder().text("[Empty]").font(FONT).align(Align.center).build());
|
||||
|
||||
float height = Math.round(label.getAutoSizeBounds().height) + 2 * PADDING;
|
||||
label.setBounds(x, y, width, height);
|
||||
@@ -371,7 +371,7 @@ public class VStack extends FDropDown {
|
||||
x += CARD_WIDTH + PADDING;
|
||||
w -= x + PADDING - BORDER_THICKNESS;
|
||||
h -= y + PADDING - BORDER_THICKNESS;
|
||||
textRenderer.drawText(g, text, FONT, foreColor, x, y, w, h, y, h, true, HAlignment.LEFT, true);
|
||||
textRenderer.drawText(g, text, FONT, foreColor, x, y, w, h, y, h, true, Align.left, true);
|
||||
|
||||
g.endClip();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.match.winlose;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -40,8 +40,8 @@ public class ViewWinLose extends FOverlay implements IWinLoseView<FButton> {
|
||||
|
||||
game = game0;
|
||||
|
||||
lblTitle = add(new FLabel.Builder().font(FSkinFont.get(30)).align(HAlignment.CENTER).build());
|
||||
lblStats = add(new FLabel.Builder().font(FSkinFont.get(26)).align(HAlignment.CENTER).build());
|
||||
lblTitle = add(new FLabel.Builder().font(FSkinFont.get(30)).align(Align.center).build());
|
||||
lblStats = add(new FLabel.Builder().font(FSkinFont.get(26)).align(Align.center).build());
|
||||
pnlOutcomes = add(new OutcomesPanel());
|
||||
|
||||
btnContinue = add(new FButton());
|
||||
@@ -88,7 +88,7 @@ public class ViewWinLose extends FOverlay implements IWinLoseView<FButton> {
|
||||
btnQuit.setFont(btnContinue.getFont());
|
||||
btnContinue.setEnabled(!game0.isMatchOver());
|
||||
|
||||
lblLog = add(new FLabel.Builder().text("Game Log").align(HAlignment.CENTER).font(FSkinFont.get(18)).build());
|
||||
lblLog = add(new FLabel.Builder().text("Game Log").align(Align.center).font(FSkinFont.get(18)).build());
|
||||
txtLog = add(new FTextArea(true, StringUtils.join(game.getGameLog().getLogEntries(null), "\r\n").replace("[COMPUTER]", "[AI]")) {
|
||||
@Override
|
||||
public boolean tap(float x, float y, int count) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.online;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -149,7 +149,7 @@ public class OnlineChatScreen extends FScreen implements IOnlineChatInterface {
|
||||
float w = getWidth() - TRIANGLE_WIDTH;
|
||||
float h = getHeight() - TEXT_INSET;
|
||||
FSkinColor color = isLocal ? LOCAL_COLOR : REMOTE_COLOR;
|
||||
HAlignment horzAlignment = isLocal ? HAlignment.RIGHT : HAlignment.LEFT;
|
||||
int horzAlignment = isLocal ? Align.right : Align.left;
|
||||
float timestampHeight = FONT.getCapHeight();
|
||||
|
||||
//draw bubble fill
|
||||
|
||||
@@ -5,8 +5,8 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -64,7 +64,7 @@ public class ConquestAEtherScreen extends FScreen {
|
||||
private final FilterButton btnRarityFilter = add(new FilterButton("Rarity", ConquestUtil.RARITY_FILTERS));
|
||||
private final FilterButton btnCMCFilter = add(new FilterButton("CMC", ConquestUtil.CMC_FILTERS));
|
||||
|
||||
private final FLabel lblShards = add(new FLabel.Builder().font(LABEL_FONT).align(HAlignment.CENTER).parseSymbols().build());
|
||||
private final FLabel lblShards = add(new FLabel.Builder().font(LABEL_FONT).align(Align.center).parseSymbols().build());
|
||||
|
||||
private PullAnimation activePullAnimation;
|
||||
private int shardCost;
|
||||
@@ -273,7 +273,7 @@ public class ConquestAEtherScreen extends FScreen {
|
||||
activePullAnimation.drawCard(g);
|
||||
}
|
||||
else {
|
||||
textRenderer.drawText(g, message, MESSAGE_FONT, Color.WHITE, 0, 0, w, h, 0, h, false, HAlignment.CENTER, true);
|
||||
textRenderer.drawText(g, message, MESSAGE_FONT, Color.WHITE, 0, 0, w, h, 0, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public class ConquestAEtherScreen extends FScreen {
|
||||
|
||||
private FilterButton(String caption0, AEtherFilter[] options0) {
|
||||
super(new FLabel.Builder().iconInBackground().pressedColor(FILTER_BUTTON_PRESSED_COLOR)
|
||||
.textColor(FILTER_BUTTON_TEXT_COLOR).alphaComposite(1f).align(HAlignment.CENTER));
|
||||
.textColor(FILTER_BUTTON_TEXT_COLOR).alphaComposite(1f).align(Align.center));
|
||||
caption = caption0;
|
||||
options = ImmutableList.copyOf(options0);
|
||||
setSelectedOption(options.get(0));
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.screens.planarconquest;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import forge.Forge;
|
||||
@@ -217,7 +217,7 @@ public class ConquestCommandersScreen extends FScreen {
|
||||
float imageSize = CardRenderer.MANA_SYMBOL_SIZE;
|
||||
ColorSet cardColor = card.getRules().getColorIdentity();
|
||||
float availableWidth = w - cardArtWidth - CardFaceSymbols.getWidth(cardColor, imageSize) - FList.PADDING;
|
||||
g.drawText(card.getName(), font, foreColor, x, y, availableWidth, imageSize, false, HAlignment.LEFT, true);
|
||||
g.drawText(card.getName(), font, foreColor, x, y, availableWidth, imageSize, false, Align.left, true);
|
||||
CardFaceSymbols.drawColorSet(g, cardColor, x + availableWidth + FList.PADDING, y, imageSize);
|
||||
|
||||
if (compactModeHandler.isCompactMode()) {
|
||||
@@ -233,7 +233,7 @@ public class ConquestCommandersScreen extends FScreen {
|
||||
float setWidth = CardRenderer.getSetWidth(font, set);
|
||||
availableWidth = w - cardArtWidth - setWidth;
|
||||
|
||||
g.drawText(commander.getOrigin() + " (" + record.getWins() + "W / " + record.getLosses() + "L)", font, foreColor, x, y, availableWidth, lineHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(commander.getOrigin() + " (" + record.getWins() + "W / " + record.getLosses() + "L)", font, foreColor, x, y, availableWidth, lineHeight, false, Align.left, true);
|
||||
|
||||
x += availableWidth + CardRenderer.SET_BOX_MARGIN;
|
||||
y -= CardRenderer.SET_BOX_MARGIN;
|
||||
|
||||
@@ -6,9 +6,9 @@ import forge.planarconquest.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
@@ -641,7 +641,7 @@ public class ConquestMultiverseScreen extends FScreen {
|
||||
float y = PADDING;
|
||||
float symbolSize = CardRenderer.MANA_SYMBOL_SIZE;
|
||||
float availableNameWidth = w - CardFaceSymbols.getWidth(regionColors, symbolSize) - 3 * PADDING;
|
||||
g.drawText(region.toString(), PLANE_NAME_FONT, LOCATION_BAR_TEXT_COLOR, x, y, availableNameWidth, symbolSize, false, HAlignment.LEFT, true);
|
||||
g.drawText(region.toString(), PLANE_NAME_FONT, LOCATION_BAR_TEXT_COLOR, x, y, availableNameWidth, symbolSize, false, Align.left, true);
|
||||
x += availableNameWidth + PADDING;
|
||||
CardFaceSymbols.drawColorSet(g, regionColors, x, y, symbolSize);
|
||||
|
||||
@@ -653,7 +653,7 @@ public class ConquestMultiverseScreen extends FScreen {
|
||||
}
|
||||
x = PADDING;
|
||||
y += symbolSize;
|
||||
g.drawText(details, EVENT_NAME_FONT, LOCATION_BAR_TEXT_COLOR, x, y, w - 2 * PADDING, h - y, false, HAlignment.CENTER, true);
|
||||
g.drawText(details, EVENT_NAME_FONT, LOCATION_BAR_TEXT_COLOR, x, y, w - 2 * PADDING, h - y, false, Align.center, true);
|
||||
|
||||
//draw top and bottom borders
|
||||
g.drawLine(1, Color.BLACK, 0, 0, w, 0);
|
||||
@@ -702,10 +702,10 @@ public class ConquestMultiverseScreen extends FScreen {
|
||||
float labelHeight = playerAvatar.getTop();
|
||||
|
||||
if (playerAvatar.card != null) {
|
||||
g.drawText(playerAvatar.card.getName(), AVATAR_NAME_FONT, Color.WHITE, PADDING, 0, labelWidth, labelHeight, false, HAlignment.LEFT, true);
|
||||
g.drawText(playerAvatar.card.getName(), AVATAR_NAME_FONT, Color.WHITE, PADDING, 0, labelWidth, labelHeight, false, Align.left, true);
|
||||
}
|
||||
if (opponentAvatar.card != null) {
|
||||
g.drawText(opponentAvatar.card.getName(), AVATAR_NAME_FONT, Color.WHITE, getWidth() - labelWidth - PADDING, getHeight() - labelHeight, labelWidth, labelHeight, false, HAlignment.RIGHT, true);
|
||||
g.drawText(opponentAvatar.card.getName(), AVATAR_NAME_FONT, Color.WHITE, getWidth() - labelWidth - PADDING, getHeight() - labelHeight, labelWidth, labelHeight, false, Align.right, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package forge.screens.planarconquest;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -206,7 +206,7 @@ public class ConquestPlaneSelector extends FDisplayObject {
|
||||
float monitorBottom = monitorTop + monitorHeight;
|
||||
float remainingHeight = h - monitorBottom;
|
||||
ConquestPlane plane = getSelectedPlane();
|
||||
g.drawText(plane.getName().replace("_", " " ), PLANE_NAME_FONT, Color.WHITE, textLeft, monitorBottom, w - 2 * textLeft, remainingHeight, false, HAlignment.CENTER, true);
|
||||
g.drawText(plane.getName().replace("_", " " ), PLANE_NAME_FONT, Color.WHITE, textLeft, monitorBottom, w - 2 * textLeft, remainingHeight, false, Align.center, true);
|
||||
|
||||
//draw left/right arrows
|
||||
float yMid = monitorBottom + remainingHeight / 2;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.planarconquest;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -57,7 +57,7 @@ public class ConquestPlaneswalkScreen extends FScreen {
|
||||
|
||||
private PlaneswalkButton() {
|
||||
super(new FLabel.Builder().font(FSkinFont.get(20)).parseSymbols().pressedColor(ConquestAEtherScreen.FILTER_BUTTON_PRESSED_COLOR)
|
||||
.textColor(ConquestAEtherScreen.FILTER_BUTTON_TEXT_COLOR).alphaComposite(1f).align(HAlignment.CENTER));
|
||||
.textColor(ConquestAEtherScreen.FILTER_BUTTON_TEXT_COLOR).alphaComposite(1f).align(Align.center));
|
||||
setCommand(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
|
||||
@@ -4,8 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.ImageKeys;
|
||||
import forge.animation.ForgeAnimation;
|
||||
@@ -281,7 +280,7 @@ public class ConquestRewardDialog extends FScrollPane {
|
||||
if (reward.isDuplicate()) {
|
||||
setFont(FSkinFont.get(20));
|
||||
setIcon(FSkinImage.AETHER_SHARD);
|
||||
setAlignment(HAlignment.CENTER);
|
||||
setAlignment(Align.center);
|
||||
setText(String.valueOf(reward.getReplacementShards()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.planarconquest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.assets.FImage;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -57,7 +57,7 @@ public class ConquestStatsScreen extends FScreen implements IVConquestStats {
|
||||
cbPlanes.addItem(plane);
|
||||
}
|
||||
}
|
||||
cbPlanes.setAlignment(HAlignment.CENTER);
|
||||
cbPlanes.setAlignment(Align.center);
|
||||
cbPlanes.setChangedHandler(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Graphics;
|
||||
@@ -55,7 +55,7 @@ public class LoadConquestScreen extends LaunchScreen {
|
||||
super(null, LoadGameMenu.getMenu());
|
||||
|
||||
lblOldConquests.setFont(FSkinFont.get(12));
|
||||
lblOldConquests.setAlignment(HAlignment.CENTER);
|
||||
lblOldConquests.setAlignment(Align.center);
|
||||
|
||||
btnNewConquest.setFont(FSkinFont.get(16));
|
||||
btnNewConquest.setCommand(new FEventHandler() {
|
||||
@@ -301,8 +301,8 @@ public class LoadConquestScreen extends LaunchScreen {
|
||||
String progress = value.getProgress();
|
||||
float winRatioWidth = font.getBounds(progress).width + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(name, font, foreColor, x, y, w - winRatioWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(progress, font, foreColor, x, y, w, h, false, HAlignment.RIGHT, false);
|
||||
g.drawText(name, font, foreColor, x, y, w - winRatioWidth, h, false, Align.left, false);
|
||||
g.drawText(progress, font, foreColor, x, y, w, h, false, Align.right, false);
|
||||
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
y += h;
|
||||
@@ -315,11 +315,11 @@ public class LoadConquestScreen extends LaunchScreen {
|
||||
font = FSkinFont.get(12);
|
||||
float cardsWidth = font.getBounds(cards).width + iconSize + SettingsScreen.SETTING_PADDING;
|
||||
float shardsWidth = font.getBounds(shards).width + iconSize + SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(value.getPlaneswalker().getName() + " - " + value.getCurrentPlane().getName().replace("_", " "), font, SettingsScreen.DESC_COLOR, x, y, w - shardsWidth - cardsWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(value.getPlaneswalker().getName() + " - " + value.getCurrentPlane().getName().replace("_", " "), font, SettingsScreen.DESC_COLOR, x, y, w - shardsWidth - cardsWidth, h, false, Align.left, false);
|
||||
g.drawImage(FSkinImage.SPELLBOOK, x + w - shardsWidth - cardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
||||
g.drawText(cards, font, SettingsScreen.DESC_COLOR, x + w - shardsWidth - cardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(cards, font, SettingsScreen.DESC_COLOR, x + w - shardsWidth - cardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, Align.left, false);
|
||||
g.drawImage(FSkinImage.AETHER_SHARD, x + w - shardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
||||
g.drawText(shards, font, SettingsScreen.DESC_COLOR, x + w - shardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(shards, font, SettingsScreen.DESC_COLOR, x + w - shardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, Align.left, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,8 +11,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -57,7 +56,7 @@ public class LoadQuestScreen extends LaunchScreen {
|
||||
super(null, LoadGameMenu.getMenu());
|
||||
|
||||
lblOldQuests.setFont(FSkinFont.get(12));
|
||||
lblOldQuests.setAlignment(HAlignment.CENTER);
|
||||
lblOldQuests.setAlignment(Align.center);
|
||||
|
||||
btnNewQuest.setFont(FSkinFont.get(16));
|
||||
btnNewQuest.setCommand(new FEventHandler() {
|
||||
@@ -304,8 +303,8 @@ public class LoadQuestScreen extends LaunchScreen {
|
||||
String winRatio = value.getAchievements().getWin() + "W / " + value.getAchievements().getLost() + "L";
|
||||
float winRatioWidth = font.getBounds(winRatio).width + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(name, font, foreColor, x, y, w - winRatioWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(winRatio, font, foreColor, x, y, w, h, false, HAlignment.RIGHT, false);
|
||||
g.drawText(name, font, foreColor, x, y, w - winRatioWidth, h, false, Align.left, false);
|
||||
g.drawText(winRatio, font, foreColor, x, y, w, h, false, Align.right, false);
|
||||
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
y += h;
|
||||
@@ -318,11 +317,11 @@ public class LoadQuestScreen extends LaunchScreen {
|
||||
font = FSkinFont.get(12);
|
||||
float cardsWidth = font.getBounds(cards).width + iconSize + SettingsScreen.SETTING_PADDING;
|
||||
float creditsWidth = font.getBounds(credits).width + iconSize + SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(FModel.getQuest().getRank(value.getAchievements().getLevel()), font, SettingsScreen.DESC_COLOR, x, y, w - creditsWidth - cardsWidth, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(FModel.getQuest().getRank(value.getAchievements().getLevel()), font, SettingsScreen.DESC_COLOR, x, y, w - creditsWidth - cardsWidth, h, false, Align.left, false);
|
||||
g.drawImage(FSkinImage.HAND, x + w - creditsWidth - cardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
||||
g.drawText(cards, font, SettingsScreen.DESC_COLOR, x + w - creditsWidth - cardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(cards, font, SettingsScreen.DESC_COLOR, x + w - creditsWidth - cardsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, Align.left, false);
|
||||
g.drawImage(FSkinImage.QUEST_COINSTACK, x + w - creditsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
||||
g.drawText(credits, font, SettingsScreen.DESC_COLOR, x + w - creditsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(credits, font, SettingsScreen.DESC_COLOR, x + w - creditsWidth + iconSize + SettingsScreen.SETTING_PADDING, y, w, h, false, Align.left, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
@@ -95,7 +95,7 @@ public class NewQuestScreen extends FScreen {
|
||||
obj.setBounds(x, y, visibleWidth / 2 - x, h); //make label take up half of line so combo boxes all the same width
|
||||
x += obj.getWidth();
|
||||
continue;
|
||||
} else if (lbl.getAlignment() == HAlignment.RIGHT) {
|
||||
} else if (lbl.getAlignment() == Align.right) {
|
||||
y -= gapY; //remove most of the padding above description text
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class NewQuestScreen extends FScreen {
|
||||
private final FLabel lblStartingPool = scroller.add(new FLabel.Builder().text("Starting pool:").build());
|
||||
private final FComboBox<StartingPoolType> cbxStartingPool = scroller.add(new FComboBox<StartingPoolType>());
|
||||
|
||||
private final FLabel lblUnrestricted = scroller.add(new FLabel.Builder().align(HAlignment.RIGHT).font(FSkinFont.get(12)).text("All cards will be available to play.").build());
|
||||
private final FLabel lblUnrestricted = scroller.add(new FLabel.Builder().align(Align.right).font(FSkinFont.get(12)).text("All cards will be available to play.").build());
|
||||
|
||||
private final FLabel lblPreconDeck = scroller.add(new FLabel.Builder().text("Starter/Event deck:").build());
|
||||
private final FComboBox<String> cbxPreconDeck = scroller.add(new FComboBox<String>());
|
||||
@@ -161,8 +161,8 @@ public class NewQuestScreen extends FScreen {
|
||||
private final FLabel lblPrizeFormat = scroller.add(new FLabel.Builder().text("Defined format:").build());
|
||||
private final FComboBox<GameFormat> cbxPrizeFormat = scroller.add(new FComboBox<GameFormat>());
|
||||
|
||||
private final FLabel lblPrizeUnrestricted = scroller.add(new FLabel.Builder().align(HAlignment.RIGHT).font(FSkinFont.get(12)).text("All cards will be available to win.").build());
|
||||
private final FLabel lblPrizeSameAsStarting = scroller.add(new FLabel.Builder().align(HAlignment.RIGHT).font(FSkinFont.get(12)).text("Only sets found in starting pool will be available.").build());
|
||||
private final FLabel lblPrizeUnrestricted = scroller.add(new FLabel.Builder().align(Align.right).font(FSkinFont.get(12)).text("All cards will be available to win.").build());
|
||||
private final FLabel lblPrizeSameAsStarting = scroller.add(new FLabel.Builder().align(Align.right).font(FSkinFont.get(12)).text("Only sets found in starting pool will be available.").build());
|
||||
private final FLabel btnPrizeSelectFormat = scroller.add(new FLabel.ButtonBuilder().text("Choose format").build());
|
||||
|
||||
private final FCheckBox cbAllowUnlocks = scroller.add(new FCheckBox("Allow unlock of additional editions"));
|
||||
|
||||
@@ -3,8 +3,8 @@ package forge.screens.quest;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
@@ -56,12 +56,12 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
||||
private static final float PADDING = Utils.scale(5);
|
||||
|
||||
private final QuestStallDefinition stallDef;
|
||||
private final FLabel lblStallName = add(new FLabel.Builder().text("").align(HAlignment.CENTER).build());
|
||||
private final FLabel lblStallName = add(new FLabel.Builder().text("").align(Align.center).build());
|
||||
private final FLabel lblEmpty = add(new FLabel.Builder().font(FSkinFont.get(12))
|
||||
.text("The merchant does not have anything useful for sale.")
|
||||
.align(HAlignment.CENTER).build());
|
||||
.align(Align.center).build());
|
||||
private final FLabel lblCredits = add(new FLabel.Builder().font(FSkinFont.get(15)).icon(FSkinImage.QUEST_COINSTACK).iconScaleFactor(1f).build());
|
||||
private final FLabel lblLife = add(new FLabel.Builder().font(lblCredits.getFont()).icon(FSkinImage.QUEST_LIFE).iconScaleFactor(1f).align(HAlignment.RIGHT).build());
|
||||
private final FLabel lblLife = add(new FLabel.Builder().font(lblCredits.getFont()).icon(FSkinImage.QUEST_LIFE).iconScaleFactor(1f).align(Align.right).build());
|
||||
private final FTextArea lblFluff = add(new FTextArea(false));
|
||||
private final FScrollPane scroller = add(new FScrollPane() {
|
||||
@Override
|
||||
@@ -87,7 +87,7 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
||||
stallDef = stallDef0;
|
||||
|
||||
lblFluff.setFont(FSkinFont.get(12));
|
||||
lblFluff.setAlignment(HAlignment.CENTER);
|
||||
lblFluff.setAlignment(Align.center);
|
||||
lblFluff.setTextColor(FLabel.INLINE_LABEL_COLOR); //make fluff text a little lighter
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.interfaces.IButton;
|
||||
@@ -10,14 +10,14 @@ import forge.toolbox.FLabel;
|
||||
|
||||
public class QuestChallengesScreen extends QuestLaunchScreen {
|
||||
private final FLabel lblInfo = add(new FLabel.Builder().text("Which challenge will you attempt?")
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
.align(Align.center).font(FSkinFont.get(16)).build());
|
||||
|
||||
private final FLabel lblCurrentDeck = add(new FLabel.Builder()
|
||||
.text("Current deck hasn't been set yet.").align(HAlignment.CENTER).insets(Vector2.Zero)
|
||||
.text("Current deck hasn't been set yet.").align(Align.center).insets(Vector2.Zero)
|
||||
.font(FSkinFont.get(12)).build());
|
||||
|
||||
private final FLabel lblNextChallengeInWins = add(new FLabel.Builder()
|
||||
.text("Next challenge in wins hasn't been set yet.").align(HAlignment.CENTER).insets(Vector2.Zero)
|
||||
.text("Next challenge in wins hasn't been set yet.").align(Align.center).insets(Vector2.Zero)
|
||||
.font(FSkinFont.get(12)).build());
|
||||
|
||||
private final QuestEventPanel.Container pnlChallenges = add(new QuestEventPanel.Container());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -34,7 +33,7 @@ public class QuestDecksScreen extends FScreen {
|
||||
private final FButton btnRandom = add(new FButton("Random Deck"));
|
||||
|
||||
private final FLabel lblInfo = add(new FLabel.Builder()
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(16))
|
||||
.align(Align.center).font(FSkinFont.get(16))
|
||||
.text("Build or select a deck").build());
|
||||
|
||||
private final FEventHandler onDeckSelectionChanged = new FEventHandler() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.interfaces.IButton;
|
||||
import forge.model.FModel;
|
||||
@@ -15,14 +15,14 @@ import java.util.List;
|
||||
public class QuestDuelsScreen extends QuestLaunchScreen {
|
||||
|
||||
private final FLabel lblInfo = add(new FLabel.Builder().text("Select your next duel.")
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
.align(Align.center).font(FSkinFont.get(16)).build());
|
||||
|
||||
private final FLabel lblCurrentDeck = add(new FLabel.Builder()
|
||||
.text("Current deck hasn't been set yet.").align(HAlignment.CENTER).insets(Vector2.Zero)
|
||||
.text("Current deck hasn't been set yet.").align(Align.center).insets(Vector2.Zero)
|
||||
.font(FSkinFont.get(12)).build());
|
||||
|
||||
private final FLabel lblNextChallengeInWins = add(new FLabel.Builder()
|
||||
.text("Next challenge in wins hasn't been set yet.").align(HAlignment.CENTER).insets(Vector2.Zero)
|
||||
.text("Next challenge in wins hasn't been set yet.").align(Align.center).insets(Vector2.Zero)
|
||||
.font(FSkinFont.get(12)).build());
|
||||
|
||||
private final QuestEventPanel.Container pnlDuels = add(new QuestEventPanel.Container());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.*;
|
||||
import forge.assets.FSkinColor.Colors;
|
||||
@@ -109,11 +109,11 @@ class QuestEventPanel extends FDisplayObject {
|
||||
//draw title
|
||||
w -= x + 2 * (RADIO_BUTTON_RADIUS + PADDING);
|
||||
String title = event.getFullTitle();
|
||||
g.drawText(title, TITLE_FONT, TITLE_COLOR, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(title, TITLE_FONT, TITLE_COLOR, x, y, w, h, false, Align.left, false);
|
||||
|
||||
//draw description
|
||||
y += TITLE_FONT.getCapHeight() + 2 * PADDING;
|
||||
g.drawText(event.getDescription(), DESC_FONT, DESC_COLOR, x, y, w, h - PADDING - y, true, HAlignment.LEFT, false);
|
||||
g.drawText(event.getDescription(), DESC_FONT, DESC_COLOR, x, y, w, h - PADDING - y, true, Align.left, false);
|
||||
|
||||
//draw radio button
|
||||
x = getWidth() - PADDING - RADIO_BUTTON_RADIUS;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.assets.FImage;
|
||||
@@ -315,7 +315,7 @@ public class QuestSpellShopScreen extends TabPageScreen<QuestSpellShopScreen> {
|
||||
|
||||
private static class InventoryPage extends SpellShopBasePage {
|
||||
protected FLabel lblSellExtras = add(new FLabel.Builder().text("Sell all extras")
|
||||
.icon(FSkinImage.MINUS).iconScaleFactor(1f).align(HAlignment.RIGHT).font(FSkinFont.get(16))
|
||||
.icon(FSkinImage.MINUS).iconScaleFactor(1f).align(Align.right).font(FSkinFont.get(16))
|
||||
.command(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.screens.quest;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.Forge;
|
||||
@@ -45,10 +45,10 @@ public class QuestTournamentsScreen extends QuestLaunchScreen implements IQuestT
|
||||
private final FLabel btnSpendToken = pnlSelectTournament.add(new FLabel.ButtonBuilder().text("Spend Token (0)").build());
|
||||
|
||||
private final FLabel lblInfo = pnlSelectTournament.add(new FLabel.Builder().text("Select a tournament to join:")
|
||||
.align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
.align(Align.center).font(FSkinFont.get(16)).build());
|
||||
|
||||
private final FLabel lblNoTournaments = pnlSelectTournament.add(new FLabel.Builder()
|
||||
.align(HAlignment.CENTER).text("There are no tournaments available at this time.").insets(Vector2.Zero)
|
||||
.align(Align.center).text("There are no tournaments available at this time.").insets(Vector2.Zero)
|
||||
.font(FSkinFont.get(12)).build());
|
||||
|
||||
private final QuestEventPanel.Container pnlTournaments = pnlSelectTournament.add(new QuestEventPanel.Container());
|
||||
@@ -372,7 +372,7 @@ public class QuestTournamentsScreen extends QuestLaunchScreen implements IQuestT
|
||||
int[] iconIDs = new int[16];
|
||||
|
||||
String draftTitle = qd.getFullTitle();
|
||||
FLabel lblStandings = add(new FLabel.Builder().text("Draft: " + draftTitle).align(HAlignment.CENTER).font(FSkinFont.get(20)).build());
|
||||
FLabel lblStandings = add(new FLabel.Builder().text("Draft: " + draftTitle).align(Align.center).font(FSkinFont.get(20)).build());
|
||||
lblStandings.setBounds(x, y, w, lblStandings.getAutoSizeBounds().height);
|
||||
y += lblStandings.getHeight() + PADDING;
|
||||
|
||||
@@ -385,7 +385,7 @@ public class QuestTournamentsScreen extends QuestLaunchScreen implements IQuestT
|
||||
String sid = qd.getStandings()[qd.getStandings().length - 1];
|
||||
String winnersName = sid.equals(QuestEventDraft.HUMAN) ? FModel.getPreferences().getPref(FPref.PLAYER_NAME) :
|
||||
sid.equals(QuestEventDraft.UNDETERMINED) ? "---" : qd.getAINames()[Integer.parseInt(sid) - 1];
|
||||
FLabel lblWinner = add(new FLabel.Builder().text("Winner: " + winnersName).align(HAlignment.CENTER).font(FSkinFont.get(20)).build());
|
||||
FLabel lblWinner = add(new FLabel.Builder().text("Winner: " + winnersName).align(Align.center).font(FSkinFont.get(20)).build());
|
||||
lblWinner.setBounds(x, y, w, lblStandings.getAutoSizeBounds().height);
|
||||
y += lblWinner.getHeight() + PADDING;
|
||||
getBtnLeaveTournamentInTourn().setText("Collect Prizes");
|
||||
@@ -427,17 +427,17 @@ public class QuestTournamentsScreen extends QuestLaunchScreen implements IQuestT
|
||||
for (int j = 0; j < 13; j += 2) {
|
||||
switch (j) {
|
||||
case 0:
|
||||
FLabel qfinals = add(new FLabel.Builder().text("QUARTERFINALS").align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
FLabel qfinals = add(new FLabel.Builder().text("QUARTERFINALS").align(Align.center).font(FSkinFont.get(16)).build());
|
||||
qfinals.setBounds(x, y, w, qfinals.getAutoSizeBounds().height);
|
||||
y += qfinals.getHeight() + PADDING;
|
||||
break;
|
||||
case 8:
|
||||
FLabel sfinals = add(new FLabel.Builder().text("SEMIFINALS").align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
FLabel sfinals = add(new FLabel.Builder().text("SEMIFINALS").align(Align.center).font(FSkinFont.get(16)).build());
|
||||
sfinals.setBounds(x, y, w, sfinals.getAutoSizeBounds().height);
|
||||
y += sfinals.getHeight() + PADDING;
|
||||
break;
|
||||
case 12:
|
||||
FLabel finals = add(new FLabel.Builder().text("FINAL MATCH").align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
FLabel finals = add(new FLabel.Builder().text("FINAL MATCH").align(Align.center).font(FSkinFont.get(16)).build());
|
||||
finals.setBounds(x, y, w, finals.getAutoSizeBounds().height);
|
||||
y += finals.getHeight() + PADDING;
|
||||
break;
|
||||
@@ -453,7 +453,7 @@ public class QuestTournamentsScreen extends QuestLaunchScreen implements IQuestT
|
||||
FTextureRegionImage avatar1 = new FTextureRegionImage(FSkin.getAvatars().get(iconIDs[j]));
|
||||
FTextureRegionImage avatar2 = new FTextureRegionImage(FSkin.getAvatars().get(iconIDs[j+1]));
|
||||
*/
|
||||
labels[j] = add(new FLabel.Builder().icon(currentMatch ? FSkinImage.STAR_FILLED : FSkinImage.STAR_OUTINE).text(labelText).align(HAlignment.CENTER).font(FSkinFont.get(16)).build());
|
||||
labels[j] = add(new FLabel.Builder().icon(currentMatch ? FSkinImage.STAR_FILLED : FSkinImage.STAR_OUTINE).text(labelText).align(Align.center).font(FSkinFont.get(16)).build());
|
||||
labels[j].setBounds(x, y, w, labels[j].getAutoSizeBounds().height);
|
||||
if (currentMatch) {
|
||||
labels[j].setTextColor(FSkinColor.get(FSkinColor.Colors.CLR_ACTIVE));
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.screens.settings;
|
||||
import forge.download.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -142,9 +142,9 @@ public class FilesPage extends TabPage<SettingsScreen> {
|
||||
float totalHeight = h;
|
||||
h = font.getMultiLineBounds(value.label).height + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(value.label, font, foreColor, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(value.label, font, foreColor, x, y, w, h, false, Align.left, false);
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, HAlignment.LEFT, false);
|
||||
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.screens.settings;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.MulliganDefs;
|
||||
@@ -456,7 +456,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
||||
w -= 2 * offset;
|
||||
h -= 2 * offset;
|
||||
|
||||
g.drawText(value, font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(value, font, foreColor, x, y, w, h, false, Align.left, true);
|
||||
|
||||
float radius = h / 3;
|
||||
x += w - radius;
|
||||
@@ -485,7 +485,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
||||
|
||||
@Override
|
||||
public void drawPrefValue(Graphics g, FSkinFont font, FSkinColor color, float x, float y, float w, float h) {
|
||||
g.drawText(FModel.getPreferences().getPref(pref), font, color, x, y, w, h, false, HAlignment.RIGHT, false);
|
||||
g.drawText(FModel.getPreferences().getPref(pref), font, color, x, y, w, h, false, Align.right, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,10 +512,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
||||
float totalHeight = h;
|
||||
h = font.getMultiLineBounds(value.label).height + SettingsScreen.SETTING_PADDING;
|
||||
|
||||
g.drawText(value.label, font, foreColor, x, y, w, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(value.label, font, foreColor, x, y, w, h, false, Align.left, false);
|
||||
value.drawPrefValue(g, font, foreColor, x, y, w, h);
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, HAlignment.LEFT, false);
|
||||
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
// An input box for handling the order of choices.
|
||||
// Left box has the original choices
|
||||
@@ -122,8 +122,8 @@ public class DualListBox<T> extends FDialog {
|
||||
}
|
||||
});
|
||||
|
||||
selectOrder = add(new FLabel.Builder().align(HAlignment.CENTER).text("Select Order").build());
|
||||
orderedLabel = add(new FLabel.Builder().align(HAlignment.CENTER).build());
|
||||
selectOrder = add(new FLabel.Builder().align(Align.center).text("Select Order").build());
|
||||
orderedLabel = add(new FLabel.Builder().align(Align.center).build());
|
||||
|
||||
setButtonState();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,7 @@ package forge.toolbox;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.UiCommand;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -16,6 +14,7 @@ import forge.assets.FSkinProp;
|
||||
import forge.interfaces.IButton;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FEvent.FEventType;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class FButton extends FDisplayObject implements IButton {
|
||||
@@ -239,7 +238,7 @@ public class FButton extends FDisplayObject implements IButton {
|
||||
if (corner == Corner.BottomLeft || corner == Corner.BottomRight) {
|
||||
displayText = displayText.replaceFirst(" ", "\n"); //allow second word to wrap if corner button
|
||||
}
|
||||
g.drawText(displayText, font, foreColor, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(displayText, font, foreColor, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FImage;
|
||||
@@ -21,7 +21,7 @@ public class FCheckBox extends FLabel implements ICheckBox {
|
||||
this(text0, false);
|
||||
}
|
||||
public FCheckBox(String text0, boolean selected0) {
|
||||
super(new Builder().text(text0).align(HAlignment.LEFT).selectable().selected(selected0));
|
||||
super(new Builder().text(text0).align(Align.left).selectable().selected(selected0));
|
||||
setIcon(new CheckBoxIcon());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkin;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -338,7 +337,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
|
||||
@Override
|
||||
public void drawValue(Graphics g, T value, FSkinFont font, FSkinColor foreColor, boolean pressed, float x, float y, float w, float h) {
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, allowDefaultItemWrap(), HAlignment.LEFT, true);
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, allowDefaultItemWrap(), Align.left, true);
|
||||
}
|
||||
}
|
||||
protected class NumberRenderer extends DefaultItemRenderer {
|
||||
@@ -365,7 +364,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
|
||||
@Override
|
||||
public void drawValue(Graphics g, T value, FSkinFont font, FSkinColor foreColor, boolean pressed, float x, float y, float w, float h) {
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(getChoiceText(value), font, foreColor, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
//special renderer for cards
|
||||
@@ -484,7 +483,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
float dx = VStack.CARD_WIDTH + FList.PADDING;
|
||||
x += dx;
|
||||
w -= dx;
|
||||
textRenderer.drawText(g, value.toString(), font, foreColor, x, y, w, h, y, h, true, HAlignment.LEFT, true);
|
||||
textRenderer.drawText(g, value.toString(), font, foreColor, x, y, w, h, y, h, true, Align.left, true);
|
||||
}
|
||||
}
|
||||
protected class PlayerItemRenderer extends ItemRenderer {
|
||||
@@ -514,7 +513,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
g.drawImage(MatchController.getPlayerAvatar(player), x - FList.PADDING, y - FList.PADDING, VAvatar.WIDTH, VAvatar.HEIGHT);
|
||||
x += VAvatar.WIDTH;
|
||||
w -= VAvatar.WIDTH;
|
||||
g.drawText(player.getName() + " (" + player.getLife() + ")", font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(player.getName() + " (" + player.getLife() + ")", font, foreColor, x, y, w, h, false, Align.left, true);
|
||||
}
|
||||
}
|
||||
protected class IHasSkinPropRenderer extends DefaultItemRenderer {
|
||||
@@ -533,7 +532,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||
x += dx;
|
||||
w -= dx;
|
||||
}
|
||||
textRenderer.drawText(g, value.toString(), font, foreColor, x, y, w, h, y, h, true, HAlignment.LEFT, true);
|
||||
textRenderer.drawText(g, value.toString(), font, foreColor, x, y, w, h, y, h, true, Align.left, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.toolbox;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.interfaces.IComboBox;
|
||||
@@ -223,7 +223,7 @@ public class FComboBox<T> extends FTextField implements IComboBox<T> {
|
||||
|
||||
@Override
|
||||
protected float getLeftPadding() {
|
||||
if (getAlignment() == HAlignment.CENTER) {
|
||||
if (getAlignment() == Align.center) {
|
||||
return getRightPadding(); //match right padding if center aligned
|
||||
}
|
||||
return super.getLeftPadding();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import forge.Forge;
|
||||
@@ -225,7 +225,7 @@ public abstract class FDialog extends FOverlay {
|
||||
if (btnMiddle != null && !title.isEmpty()) { //render title above prompt if middle button present
|
||||
y -= MSG_HEIGHT;
|
||||
g.fillRect(VPrompt.BACK_COLOR, 0, y, w, MSG_HEIGHT);
|
||||
g.drawText(title, VPrompt.FONT, VPrompt.FORE_COLOR, 0, y, w, MSG_HEIGHT, false, HAlignment.CENTER, true);
|
||||
g.drawText(title, VPrompt.FONT, VPrompt.FORE_COLOR, 0, y, w, MSG_HEIGHT, false, Align.center, true);
|
||||
}
|
||||
g.drawLine(BORDER_THICKNESS, BORDER_COLOR, 0, y, w, y);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -394,7 +394,7 @@ public class FFileChooser extends FDialog {
|
||||
g.drawImage(FSkinImage.FOLDER, x, y + (h - iconSize) / 2, iconSize, iconSize);
|
||||
x += iconSize + FList.PADDING;
|
||||
}
|
||||
g.drawText(value.getName(), font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(value.getName(), font, foreColor, x, y, w, h, false, Align.left, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -32,7 +31,7 @@ public abstract class FGroupBox extends FContainer {
|
||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, w, h, w, y); //draw right border
|
||||
|
||||
//draw caption
|
||||
g.drawText(caption, FONT, FORE_COLOR, x, 0, w - x - PADDING, h, false, HAlignment.LEFT, false);
|
||||
g.drawText(caption, FONT, FORE_COLOR, x, 0, w - x - PADDING, h, false, Align.left, false);
|
||||
|
||||
//draw border left of caption
|
||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, 0, y, x, y);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.UiCommand;
|
||||
@@ -15,8 +14,8 @@ import forge.assets.FSkinFont;
|
||||
import forge.interfaces.IButton;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FEvent.FEventType;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class FLabel extends FDisplayObject implements IButton {
|
||||
public static final float DEFAULT_INSETS = Utils.scale(3);
|
||||
|
||||
@@ -25,7 +24,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
private float bldIconScaleFactor = 0.8f;
|
||||
private FSkinFont bldFont = FSkinFont.get(14);
|
||||
private float bldAlphaComposite = 0.7f;
|
||||
private HAlignment bldAlignment = HAlignment.LEFT;
|
||||
private int bldAlignment = Align.left;
|
||||
private Vector2 bldInsets = new Vector2(DEFAULT_INSETS, DEFAULT_INSETS);
|
||||
|
||||
private boolean bldSelectable = false;
|
||||
@@ -48,7 +47,8 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
// Begin builder methods.
|
||||
public Builder text(final String s0) { this.bldText = s0; return this; }
|
||||
public Builder icon(final FImage i0) { this.bldIcon = i0; return this; }
|
||||
public Builder align(final HAlignment a0) { this.bldAlignment = a0; return this; }
|
||||
//public Builder align(final HAlignment a0) { this.bldAlignment = a0; return this; }
|
||||
public Builder align(final int a0) { this.bldAlignment = a0; return this; }
|
||||
public Builder insets(final Vector2 v0) { this.bldInsets = v0; return this; }
|
||||
public Builder opaque(final boolean b0) { this.bldOpaque = b0; return this; }
|
||||
public Builder opaque() { opaque(true); return this; }
|
||||
@@ -75,7 +75,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
public static class ButtonBuilder extends Builder {
|
||||
public ButtonBuilder() {
|
||||
opaque();
|
||||
align(HAlignment.CENTER);
|
||||
align(Align.center);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
private float iconScaleFactor;
|
||||
private FSkinFont font;
|
||||
private float alphaComposite;
|
||||
private HAlignment alignment;
|
||||
private int alignment;
|
||||
private Vector2 insets;
|
||||
private boolean selectable, selected, opaque, iconInBackground, iconScaleAuto, iconScaleWithFont, pressed;
|
||||
|
||||
@@ -186,10 +186,10 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
insets = insets0;
|
||||
}
|
||||
|
||||
public HAlignment getAlignment() {
|
||||
public int getAlignment() {
|
||||
return alignment;
|
||||
}
|
||||
public void setAlignment(final HAlignment alignment0) {
|
||||
public void setAlignment(final int alignment0) {
|
||||
alignment = alignment0;
|
||||
}
|
||||
|
||||
@@ -342,13 +342,13 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
float iconOffset = iconWidth + insets.x + getExtraGapBetweenIconAndText();
|
||||
|
||||
if (iconInBackground || text.isEmpty()) {
|
||||
if (alignment == HAlignment.CENTER) {
|
||||
if (alignment == Align.center) {
|
||||
x += (w - iconWidth) / 2;
|
||||
}
|
||||
y += (h - iconHeight) / 2;
|
||||
}
|
||||
else {
|
||||
if (alignment == HAlignment.CENTER) {
|
||||
if (alignment == Align.center) {
|
||||
float dx;
|
||||
while (true) {
|
||||
dx = (w - iconOffset - getTextWidth()) / 2;
|
||||
@@ -362,7 +362,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
font = font.shrink();
|
||||
}
|
||||
}
|
||||
else if (alignment == HAlignment.RIGHT) {
|
||||
else if (alignment == Align.right) {
|
||||
float dx;
|
||||
while (true) {
|
||||
dx = (w - iconWidth - getTextWidth() - insets.x);
|
||||
@@ -384,7 +384,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
if (!text.isEmpty()) {
|
||||
x += iconOffset;
|
||||
w -= iconOffset;
|
||||
drawText(g, x, textY, w, h, HAlignment.LEFT);
|
||||
drawText(g, x, textY, w, h, Align.left);
|
||||
}
|
||||
}
|
||||
else if (!text.isEmpty()) {
|
||||
@@ -392,7 +392,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
||||
}
|
||||
}
|
||||
|
||||
private void drawText(Graphics g, float x, float y, float w, float h, HAlignment align) {
|
||||
private void drawText(Graphics g, float x, float y, float w, float h, int align) {
|
||||
g.startClip(x, y, w, h);
|
||||
if (textRenderer == null) {
|
||||
g.drawText(text, font, textColor, x, y, w, h, false, align, true);
|
||||
|
||||
@@ -4,8 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -321,7 +320,7 @@ public class FList<T> extends FScrollPane implements Iterable<T> {
|
||||
|
||||
@Override
|
||||
public void drawValue(Graphics g, Integer index, V value, FSkinFont font, FSkinColor foreColor, FSkinColor backColor, boolean pressed, float x, float y, float w, float h) {
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w, h, false, HAlignment.LEFT, true);
|
||||
g.drawText(value.toString(), font, foreColor, x, y, w, h, false, Align.left, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
public class FNumericTextField extends FTextField {
|
||||
private int value;
|
||||
|
||||
public FNumericTextField() {
|
||||
setAlignment(HAlignment.RIGHT);
|
||||
setAlignment(Align.right);
|
||||
}
|
||||
|
||||
public FNumericTextField(int value0) {
|
||||
setAlignment(HAlignment.RIGHT);
|
||||
setAlignment(Align.right);
|
||||
setValue(value0);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
@@ -239,7 +240,7 @@ public class FOptionPane extends FDialog {
|
||||
centerIcon = icon.getWidth() >= 100; //for large icon, center in dialog
|
||||
lblIcon = add(new FLabel.Builder().icon(icon).iconScaleFactor(1).insets(new Vector2(0, 0)).iconInBackground(centerIcon).build());
|
||||
if (centerIcon) {
|
||||
lblIcon.setAlignment(HAlignment.CENTER);
|
||||
lblIcon.setAlignment(Align.center);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -251,7 +252,7 @@ public class FOptionPane extends FDialog {
|
||||
prompt = add(new FTextArea(true, message));
|
||||
prompt.setFont(messageFont != null ? messageFont : FSkinFont.get(12));
|
||||
if (centerIcon || centerPrompt()) {
|
||||
prompt.setAlignment(HAlignment.CENTER);
|
||||
prompt.setAlignment(Align.center);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.interfaces.IProgressBar;
|
||||
@@ -161,13 +162,13 @@ public class FProgressBar extends FDisplayObject implements IProgressBar {
|
||||
MSG_FONT = FSkinFont.get(11);
|
||||
}
|
||||
|
||||
g.drawText(message, MSG_FONT, FORE_COLOR, 0, 0, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(message, MSG_FONT, FORE_COLOR, 0, 0, w, h, false, Align.center, true);
|
||||
|
||||
//draw text using selection fore color in needed regions over top of regular text using clipping
|
||||
if (!SEL_FORE_COLOR.equals(FORE_COLOR)) {
|
||||
for (Pair<Float, Float> region : selTextRegions) {
|
||||
g.startClip(region.getLeft(), 0, region.getRight(), h);
|
||||
g.drawText(message, MSG_FONT, SEL_FORE_COLOR, 0, 0, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(message, MSG_FONT, SEL_FORE_COLOR, 0, 0, w, h, false, Align.center, true);
|
||||
g.endClip();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.toolbox;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FImage;
|
||||
@@ -25,7 +25,7 @@ public class FRadioButton extends FLabel {
|
||||
this(text0, false);
|
||||
}
|
||||
public FRadioButton(String text0, boolean selected0) {
|
||||
super(new Builder().text(text0).align(HAlignment.LEFT).selectable().selected(selected0));
|
||||
super(new Builder().text(text0).align(Align.left).selectable().selected(selected0));
|
||||
setIcon(new RadioButtonIcon());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -11,7 +11,7 @@ import forge.assets.TextRenderer;
|
||||
public class FTextArea extends FScrollPane {
|
||||
private String text;
|
||||
private FSkinFont font;
|
||||
private HAlignment alignment;
|
||||
private int alignment;
|
||||
private Vector2 insets;
|
||||
private FSkinColor textColor;
|
||||
private final TextRenderer renderer;
|
||||
@@ -23,7 +23,7 @@ public class FTextArea extends FScrollPane {
|
||||
public FTextArea(boolean parseReminderText0, String text0) {
|
||||
text = text0;
|
||||
font = FSkinFont.get(14);
|
||||
alignment = HAlignment.LEFT;
|
||||
alignment = Align.left;
|
||||
insets = new Vector2(1, 1); //prevent text getting cut off by clip
|
||||
textColor = FLabel.DEFAULT_TEXT_COLOR;
|
||||
renderer = new TextRenderer(parseReminderText0);
|
||||
@@ -37,10 +37,10 @@ public class FTextArea extends FScrollPane {
|
||||
revalidate();
|
||||
}
|
||||
|
||||
public HAlignment getAlignment() {
|
||||
public int getAlignment() {
|
||||
return alignment;
|
||||
}
|
||||
public void setAlignment(HAlignment alignment0) {
|
||||
public void setAlignment(int alignment0) {
|
||||
alignment = alignment0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Forge;
|
||||
import forge.Forge.KeyInputAdapter;
|
||||
import forge.Graphics;
|
||||
@@ -15,6 +13,7 @@ import forge.menu.FMenuItem;
|
||||
import forge.menu.FPopupMenu;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FEvent.FEventType;
|
||||
import forge.util.TextBounds;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class FTextField extends FDisplayObject implements ITextField {
|
||||
@@ -36,7 +35,7 @@ public class FTextField extends FDisplayObject implements ITextField {
|
||||
|
||||
private String text, ghostText, textBeforeKeyInput;
|
||||
protected FSkinFont font, renderedFont;
|
||||
private HAlignment alignment;
|
||||
private int alignment;
|
||||
private int selStart, selLength;
|
||||
private boolean isEditing, readOnly;
|
||||
|
||||
@@ -82,7 +81,7 @@ public class FTextField extends FDisplayObject implements ITextField {
|
||||
text = text0;
|
||||
ghostText = "";
|
||||
setFont(DEFAULT_FONT);
|
||||
alignment = HAlignment.LEFT;
|
||||
alignment = Align.left;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
@@ -132,10 +131,10 @@ public class FTextField extends FDisplayObject implements ITextField {
|
||||
return text.isEmpty();
|
||||
}
|
||||
|
||||
public HAlignment getAlignment() {
|
||||
public int getAlignment() {
|
||||
return alignment;
|
||||
}
|
||||
public void setAlignment(HAlignment alignment0) {
|
||||
public void setAlignment(int alignment0) {
|
||||
alignment = alignment0;
|
||||
}
|
||||
|
||||
@@ -434,12 +433,12 @@ public class FTextField extends FDisplayObject implements ITextField {
|
||||
|
||||
protected float getTextLeft() {
|
||||
switch (alignment) {
|
||||
case LEFT:
|
||||
case Align.left:
|
||||
default:
|
||||
return getLeftPadding();
|
||||
case CENTER:
|
||||
case Align.center:
|
||||
return getLeftPadding() + (getWidth() - getRightPadding() - getLeftPadding() - renderedFont.getBounds(text).width) / 2;
|
||||
case RIGHT:
|
||||
case Align.right:
|
||||
return getWidth() - getRightPadding() - renderedFont.getBounds(text).width;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.Graphics;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinColor.Colors;
|
||||
@@ -167,6 +166,6 @@ public class FToggleSwitch extends FDisplayObject {
|
||||
|
||||
x += PADDING;
|
||||
w -= 2 * PADDING;
|
||||
g.drawText(text, font, FORE_COLOR, x, y, w, h, false, HAlignment.CENTER, true);
|
||||
g.drawText(text, font, FORE_COLOR, x, y, w, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
15
forge-gui-mobile/src/forge/util/TextBounds.java
Normal file
15
forge-gui-mobile/src/forge/util/TextBounds.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package forge.util;
|
||||
|
||||
public class TextBounds {
|
||||
public float width;
|
||||
public float height;
|
||||
|
||||
public TextBounds() {
|
||||
|
||||
}
|
||||
|
||||
public TextBounds(float width, float height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user