Skip to content
Snippets Groups Projects
Commit 1bfcd076 authored by Anton Danilov's avatar Anton Danilov
Browse files

Merge branch 'feature-fontnew' into feature-encyclopedia

parents a351fbe2 d1a9de32
Branches
Tags
No related merge requests found
......@@ -200,4 +200,6 @@ char id=366 x=457 y=0 width=35 height=46 xoffset=-8 yoffset=-8 xad
char id=367 x=351 y=138 width=32 height=41 xoffset=-8 yoffset=-3 xadvance=18 page=0 chnl=0
char id=381 x=312 y=93 width=34 height=45 xoffset=-8 yoffset=-7 xadvance=19 page=0 chnl=0
char id=382 x=40 y=262 width=31 height=40 xoffset=-8 yoffset=-2 xadvance=16 page=0 chnl=0
char id=8220 x=207 y=487 width=27 height=24 xoffset=-8 yoffset=-2 xadvance=13 page=0 chnl=0
char id=8222 x=179 y=487 width=28 height=25 xoffset=-8 yoffset=18 xadvance=13 page=0 chnl=0
char id=8230 x=0 y=489 width=37 height=21 xoffset=-8 yoffset=17 xadvance=24 page=0 chnl=0
android/assets/font/roboto-bold.png

102 KiB | W: | H:

android/assets/font/roboto-bold.png

103 KiB | W: | H:

android/assets/font/roboto-bold.png
android/assets/font/roboto-bold.png
android/assets/font/roboto-bold.png
android/assets/font/roboto-bold.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -199,4 +199,6 @@ char id=366 x=305 y=0 width=33 height=47 xoffset=-8 yoffset=-9 xad
char id=367 x=297 y=140 width=30 height=41 xoffset=-8 yoffset=-3 xadvance=18 page=0 chnl=0
char id=381 x=431 y=95 width=33 height=45 xoffset=-8 yoffset=-7 xadvance=19 page=0 chnl=0
char id=382 x=180 y=382 width=30 height=39 xoffset=-8 yoffset=-1 xadvance=16 page=0 chnl=0
char id=8220 x=457 y=475 width=26 height=23 xoffset=-8 yoffset=-2 xadvance=11 page=0 chnl=0
char id=8222 x=431 y=475 width=26 height=25 xoffset=-8 yoffset=18 xadvance=11 page=0 chnl=0
char id=8230 x=340 y=454 width=33 height=20 xoffset=-8 yoffset=18 xadvance=21 page=0 chnl=0
android/assets/font/roboto-regular.png

103 KiB | W: | H:

android/assets/font/roboto-regular.png

103 KiB | W: | H:

android/assets/font/roboto-regular.png
android/assets/font/roboto-regular.png
android/assets/font/roboto-regular.png
android/assets/font/roboto-regular.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,12 +2,9 @@ package cz.nic.tablexia.debug;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Cell;
import com.badlogic.gdx.scenes.scene2d.ui.Container;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Disposable;
......@@ -22,8 +19,10 @@ import cz.nic.tablexia.TablexiaApplication.ScreenChangedEvent;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.bus.ApplicationBus;
import cz.nic.tablexia.loader.application.ApplicationAtlasManager;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.shared.model.User;
import cz.nic.tablexia.screen.AbstractTablexiaScreen.ScreenInfoEvent;
import cz.nic.tablexia.util.ui.TablexiaLabel;
import static com.badlogic.gdx.scenes.scene2d.actions.Actions.alpha;
......@@ -36,18 +35,18 @@ public class DebugInfo extends Table implements Disposable {
private static class DebugInfoComponent extends Table {
private Map<String, Label> infoLabelMap;
private LabelStyle labelStyle;
private Map<String, TablexiaLabel> infoLabelMap;
private TablexiaLabel.TablexiaLabelStyle labelStyle;
public DebugInfoComponent() {
infoLabelMap = new HashMap<String, Label>();
infoLabelMap = new HashMap<String, TablexiaLabel>();
setBackground(new TextureRegionDrawable(ApplicationAtlasManager.getInstance().getColorTextureRegion(BACKGROUND_COLOR)));
addAction(alpha(BACKGROUND_ALPHA));
labelStyle = new LabelStyle(new BitmapFont(), FONT_COLOR);
labelStyle = new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType_NEW.REGULAR_12, FONT_COLOR);
}
public synchronized void setInfoValue(String infoKey, String infoValue) {
Label label = infoLabelMap.get(infoKey);
TablexiaLabel label = infoLabelMap.get(infoKey);
if (label == null) {
createInfoLabel(infoKey, infoValue);
} else {
......@@ -61,12 +60,12 @@ public class DebugInfo extends Table implements Disposable {
}
private void createInfoLabel(String infoKey, String infoValue) {
Label infoLabel = new Label(infoKey + KEY_COLON + infoValue, labelStyle);
TablexiaLabel infoLabel = new TablexiaLabel(infoKey + KEY_COLON + infoValue, labelStyle);
infoLabelMap.put(infoKey, infoLabel);
clearChildren();
for (Label label : infoLabelMap.values()) {
Cell<Label> cell = add(label);
for (TablexiaLabel label : infoLabelMap.values()) {
Cell<TablexiaLabel> cell = add(label);
if (getCells().size > 1) {
cell.pad(0, INFO_PADDING, 0, 0);
}
......@@ -138,7 +137,7 @@ public class DebugInfo extends Table implements Disposable {
public void update() {
if (applicationDebugInfo != null) {
User selectedUser = TablexiaSettings.getInstance().getSelectedUser();
applicationDebugInfo.setInfoValue(USER, selectedUser == null ? NO_VALUE : selectedUser.getName() + "[" + selectedUser.getId() + "]");
applicationDebugInfo.setInfoValue(USER, selectedUser == null ? NO_VALUE : selectedUser.getName() + " (" + selectedUser.getId() + ")");
applicationDebugInfo.setInfoValue(FPS, "" + Gdx.graphics.getFramesPerSecond());
applicationDebugInfo.setInfoValue(JAVA_HEAP, ("" + Gdx.app.getJavaHeap() / MB_SIZE) + UNIT_MB);
applicationDebugInfo.setInfoValue(NATIVE_HEAP, ("" + Gdx.app.getNativeHeap() / MB_SIZE) + UNIT_MB);
......
......@@ -143,5 +143,8 @@ public class ApplicationFontManager implements IApplicationLoader {
@Override
public synchronized void dispose() {
instance = null;
robotoRegularFont.dispose();
robotoBoldFont.dispose();
distanceFieldShader.dispose();
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment