mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-20 09:17:29 +07:00
Added i18n factory method to create instances with resolved string id
This commit is contained in:
parent
475018e6f6
commit
fba74adb74
@ -3,6 +3,7 @@ package com.riiablo.widget;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.graphics.PaletteIndexedBatch;
|
||||
|
||||
@ -24,11 +25,24 @@ public class LabelButton extends Label {
|
||||
init();
|
||||
}
|
||||
|
||||
public LabelButton(String text, BitmapFont font, Color color) {
|
||||
super(text, font, color);
|
||||
init();
|
||||
}
|
||||
|
||||
public LabelButton(BitmapFont font) {
|
||||
super(font);
|
||||
init();
|
||||
}
|
||||
|
||||
public static LabelButton i18n(String id, BitmapFont font) {
|
||||
return new LabelButton(Riiablo.string.lookup(id), font);
|
||||
}
|
||||
|
||||
public static LabelButton i18n(String id, BitmapFont font, Color color) {
|
||||
return new LabelButton(Riiablo.string.lookup(id), font, color);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
addListener(clickListener = new ClickListener());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user