diff --git a/editor/assets/skin/roboto-dff.fnt b/editor/assets/skin/roboto-dff.fnt deleted file mode 100644 index cc5a7b1a4..000000000 --- a/editor/assets/skin/roboto-dff.fnt +++ /dev/null @@ -1,199 +0,0 @@ -info face="Roboto Medium" size=16 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=5,5,5,5 spacing=-10,-10 -common lineHeight=19 base=15 scaleW=1024 scaleH=1024 pages=1 packed=0 -page id=0 file="roboto-dff.png" -chars count=98 -char id=0 x=0 y=0 width=0 height=0 xoffset=-5 yoffset=0 xadvance=0 page=0 chnl=0 -char id=10 x=0 y=0 width=0 height=0 xoffset=-5 yoffset=0 xadvance=0 page=0 chnl=0 -char id=32 x=0 y=0 width=0 height=0 xoffset=-5 yoffset=0 xadvance=4 page=0 chnl=0 -char id=33 x=591 y=0 width=13 height=23 xoffset=-4 yoffset=-2 xadvance=4 page=0 chnl=0 -char id=34 x=525 y=27 width=15 height=16 xoffset=-5 yoffset=-3 xadvance=5 page=0 chnl=0 -char id=35 x=161 y=27 width=20 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=36 x=128 y=0 width=19 height=26 xoffset=-5 yoffset=-4 xadvance=9 page=0 chnl=0 -char id=37 x=669 y=0 width=22 height=23 xoffset=-5 yoffset=-2 xadvance=12 page=0 chnl=0 -char id=38 x=691 y=0 width=21 height=23 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=39 x=540 y=27 width=13 height=16 xoffset=-5 yoffset=-3 xadvance=3 page=0 chnl=0 -char id=40 x=0 y=0 width=15 height=27 xoffset=-4 yoffset=-3 xadvance=6 page=0 chnl=0 -char id=41 x=15 y=0 width=15 height=27 xoffset=-5 yoffset=-3 xadvance=6 page=0 chnl=0 -char id=42 x=491 y=27 width=17 height=18 xoffset=-5 yoffset=-2 xadvance=7 page=0 chnl=0 -char id=43 x=437 y=27 width=19 height=19 xoffset=-5 yoffset=0 xadvance=9 page=0 chnl=0 -char id=44 x=570 y=27 width=13 height=15 xoffset=-5 yoffset=8 xadvance=4 page=0 chnl=0 -char id=45 x=648 y=27 width=15 height=12 xoffset=-5 yoffset=4 xadvance=5 page=0 chnl=0 -char id=46 x=597 y=27 width=13 height=14 xoffset=-4 yoffset=7 xadvance=4 page=0 chnl=0 -char id=47 x=636 y=0 width=16 height=23 xoffset=-5 yoffset=-2 xadvance=6 page=0 chnl=0 -char id=48 x=572 y=0 width=19 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=49 x=88 y=27 width=16 height=22 xoffset=-4 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=50 x=104 y=27 width=19 height=22 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=51 x=478 y=0 width=19 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=52 x=123 y=27 width=19 height=22 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=53 x=497 y=0 width=18 height=23 xoffset=-4 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=54 x=515 y=0 width=19 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=55 x=142 y=27 width=19 height=22 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=56 x=534 y=0 width=19 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=57 x=553 y=0 width=19 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=58 x=181 y=27 width=13 height=21 xoffset=-4 yoffset=0 xadvance=4 page=0 chnl=0 -char id=59 x=622 y=0 width=14 height=23 xoffset=-5 yoffset=0 xadvance=4 page=0 chnl=0 -char id=60 x=456 y=27 width=18 height=18 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=61 x=553 y=27 width=17 height=16 xoffset=-4 yoffset=2 xadvance=9 page=0 chnl=0 -char id=62 x=474 y=27 width=17 height=18 xoffset=-4 yoffset=1 xadvance=8 page=0 chnl=0 -char id=63 x=604 y=0 width=18 height=23 xoffset=-5 yoffset=-2 xadvance=8 page=0 chnl=0 -char id=64 x=104 y=0 width=24 height=26 xoffset=-5 yoffset=-2 xadvance=14 page=0 chnl=0 -char id=65 x=712 y=0 width=21 height=22 xoffset=-5 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=66 x=733 y=0 width=19 height=22 xoffset=-4 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=67 x=218 y=0 width=20 height=23 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=68 x=752 y=0 width=19 height=22 xoffset=-4 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=69 x=771 y=0 width=18 height=22 xoffset=-4 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=70 x=789 y=0 width=18 height=22 xoffset=-4 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=71 x=238 y=0 width=20 height=23 xoffset=-5 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=72 x=807 y=0 width=20 height=22 xoffset=-4 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=73 x=827 y=0 width=13 height=22 xoffset=-4 yoffset=-2 xadvance=5 page=0 chnl=0 -char id=74 x=258 y=0 width=18 height=23 xoffset=-5 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=75 x=840 y=0 width=20 height=22 xoffset=-4 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=76 x=860 y=0 width=18 height=22 xoffset=-4 yoffset=-2 xadvance=9 page=0 chnl=0 -char id=77 x=878 y=0 width=22 height=22 xoffset=-4 yoffset=-2 xadvance=14 page=0 chnl=0 -char id=78 x=900 y=0 width=20 height=22 xoffset=-4 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=79 x=276 y=0 width=21 height=23 xoffset=-5 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=80 x=920 y=0 width=19 height=22 xoffset=-4 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=81 x=159 y=0 width=21 height=24 xoffset=-5 yoffset=-2 xadvance=11 page=0 chnl=0 -char id=82 x=939 y=0 width=19 height=22 xoffset=-4 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=83 x=297 y=0 width=20 height=23 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=84 x=958 y=0 width=20 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=85 x=317 y=0 width=20 height=23 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=86 x=978 y=0 width=21 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=87 x=999 y=0 width=24 height=22 xoffset=-5 yoffset=-2 xadvance=14 page=0 chnl=0 -char id=88 x=0 y=27 width=20 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=89 x=20 y=27 width=20 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=90 x=40 y=27 width=20 height=22 xoffset=-5 yoffset=-2 xadvance=10 page=0 chnl=0 -char id=91 x=30 y=0 width=14 height=27 xoffset=-4 yoffset=-4 xadvance=4 page=0 chnl=0 -char id=92 x=652 y=0 width=17 height=23 xoffset=-5 yoffset=-2 xadvance=7 page=0 chnl=0 -char id=93 x=44 y=0 width=14 height=27 xoffset=-5 yoffset=-4 xadvance=4 page=0 chnl=0 -char id=94 x=508 y=27 width=17 height=17 xoffset=-5 yoffset=-2 xadvance=7 page=0 chnl=0 -char id=95 x=630 y=27 width=18 height=13 xoffset=-5 yoffset=9 xadvance=7 page=0 chnl=0 -char id=96 x=583 y=27 width=14 height=14 xoffset=-5 yoffset=-3 xadvance=5 page=0 chnl=0 -char id=97 x=194 y=27 width=18 height=20 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=98 x=180 y=0 width=19 height=24 xoffset=-5 yoffset=-3 xadvance=9 page=0 chnl=0 -char id=99 x=212 y=27 width=18 height=20 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=100 x=199 y=0 width=19 height=24 xoffset=-5 yoffset=-3 xadvance=9 page=0 chnl=0 -char id=101 x=230 y=27 width=19 height=20 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=102 x=337 y=0 width=16 height=23 xoffset=-5 yoffset=-3 xadvance=6 page=0 chnl=0 -char id=103 x=353 y=0 width=19 height=23 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=104 x=372 y=0 width=18 height=23 xoffset=-5 yoffset=-3 xadvance=9 page=0 chnl=0 -char id=105 x=60 y=27 width=13 height=22 xoffset=-4 yoffset=-2 xadvance=4 page=0 chnl=0 -char id=106 x=58 y=0 width=15 height=26 xoffset=-6 yoffset=-2 xadvance=4 page=0 chnl=0 -char id=107 x=390 y=0 width=19 height=23 xoffset=-5 yoffset=-3 xadvance=8 page=0 chnl=0 -char id=108 x=409 y=0 width=13 height=23 xoffset=-4 yoffset=-3 xadvance=4 page=0 chnl=0 -char id=109 x=304 y=27 width=23 height=19 xoffset=-5 yoffset=1 xadvance=14 page=0 chnl=0 -char id=110 x=327 y=27 width=18 height=19 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=111 x=249 y=27 width=19 height=20 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=112 x=422 y=0 width=19 height=23 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=113 x=441 y=0 width=19 height=23 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=114 x=345 y=27 width=16 height=19 xoffset=-5 yoffset=1 xadvance=6 page=0 chnl=0 -char id=115 x=268 y=27 width=18 height=20 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=116 x=73 y=27 width=15 height=22 xoffset=-5 yoffset=-1 xadvance=5 page=0 chnl=0 -char id=117 x=286 y=27 width=18 height=20 xoffset=-5 yoffset=1 xadvance=9 page=0 chnl=0 -char id=118 x=361 y=27 width=18 height=19 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=119 x=379 y=27 width=22 height=19 xoffset=-5 yoffset=1 xadvance=12 page=0 chnl=0 -char id=120 x=401 y=27 width=18 height=19 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=121 x=460 y=0 width=18 height=23 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=122 x=419 y=27 width=18 height=19 xoffset=-5 yoffset=1 xadvance=8 page=0 chnl=0 -char id=123 x=73 y=0 width=16 height=26 xoffset=-5 yoffset=-3 xadvance=5 page=0 chnl=0 -char id=124 x=147 y=0 width=12 height=25 xoffset=-4 yoffset=-2 xadvance=4 page=0 chnl=0 -char id=125 x=89 y=0 width=15 height=26 xoffset=-5 yoffset=-3 xadvance=5 page=0 chnl=0 -char id=126 x=610 y=27 width=20 height=14 xoffset=-5 yoffset=3 xadvance=11 page=0 chnl=0 -char id=127 x=0 y=0 width=0 height=0 xoffset=-5 yoffset=0 xadvance=4 page=0 chnl=0 -kernings count=96 -kerning first=44 second=34 amount=-2 -kerning first=119 second=44 amount=-1 -kerning first=47 second=47 amount=-2 -kerning first=84 second=74 amount=-2 -kerning first=76 second=87 amount=-1 -kerning first=84 second=121 amount=-1 -kerning first=86 second=65 amount=-1 -kerning first=89 second=103 amount=-1 -kerning first=86 second=46 amount=-2 -kerning first=39 second=65 amount=-1 -kerning first=86 second=45 amount=-1 -kerning first=76 second=39 amount=-2 -kerning first=89 second=45 amount=-1 -kerning first=84 second=100 amount=-1 -kerning first=65 second=39 amount=-1 -kerning first=89 second=65 amount=-1 -kerning first=89 second=44 amount=-2 -kerning first=114 second=46 amount=-1 -kerning first=46 second=34 amount=-2 -kerning first=84 second=101 amount=-1 -kerning first=87 second=44 amount=-1 -kerning first=89 second=46 amount=-2 -kerning first=114 second=44 amount=-1 -kerning first=89 second=85 amount=-1 -kerning first=84 second=97 amount=-1 -kerning first=118 second=46 amount=-1 -kerning first=104 second=34 amount=-1 -kerning first=89 second=101 amount=-1 -kerning first=84 second=115 amount=-1 -kerning first=76 second=34 amount=-2 -kerning first=65 second=34 amount=-1 -kerning first=70 second=44 amount=-2 -kerning first=46 second=39 amount=-2 -kerning first=84 second=117 amount=-1 -kerning first=75 second=45 amount=-1 -kerning first=84 second=65 amount=-1 -kerning first=84 second=44 amount=-2 -kerning first=84 second=114 amount=-1 -kerning first=89 second=99 amount=-1 -kerning first=89 second=113 amount=-1 -kerning first=76 second=84 amount=-2 -kerning first=109 second=34 amount=-1 -kerning first=65 second=84 amount=-1 -kerning first=80 second=46 amount=-3 -kerning first=89 second=100 amount=-1 -kerning first=79 second=84 amount=-1 -kerning first=104 second=39 amount=-1 -kerning first=111 second=34 amount=-1 -kerning first=70 second=74 amount=-2 -kerning first=76 second=118 amount=-1 -kerning first=68 second=44 amount=-1 -kerning first=88 second=45 amount=-1 -kerning first=68 second=84 amount=-1 -kerning first=84 second=118 amount=-1 -kerning first=79 second=44 amount=-1 -kerning first=109 second=39 amount=-1 -kerning first=34 second=65 amount=-1 -kerning first=70 second=65 amount=-1 -kerning first=44 second=39 amount=-2 -kerning first=118 second=44 amount=-1 -kerning first=68 second=46 amount=-1 -kerning first=65 second=86 amount=-1 -kerning first=89 second=74 amount=-1 -kerning first=34 second=111 amount=-1 -kerning first=84 second=109 amount=-1 -kerning first=79 second=46 amount=-1 -kerning first=84 second=110 amount=-1 -kerning first=76 second=86 amount=-2 -kerning first=84 second=111 amount=-2 -kerning first=119 second=46 amount=-1 -kerning first=76 second=89 amount=-2 -kerning first=121 second=44 amount=-1 -kerning first=111 second=39 amount=-1 -kerning first=121 second=46 amount=-1 -kerning first=65 second=89 amount=-1 -kerning first=34 second=115 amount=-1 -kerning first=84 second=45 amount=-2 -kerning first=84 second=99 amount=-1 -kerning first=84 second=120 amount=-1 -kerning first=76 second=121 amount=-1 -kerning first=84 second=103 amount=-1 -kerning first=80 second=74 amount=-1 -kerning first=70 second=46 amount=-2 -kerning first=84 second=46 amount=-2 -kerning first=65 second=63 amount=-1 -kerning first=110 second=39 amount=-1 -kerning first=84 second=112 amount=-1 -kerning first=80 second=65 amount=-1 -kerning first=80 second=44 amount=-3 -kerning first=39 second=111 amount=-1 -kerning first=89 second=111 amount=-1 -kerning first=87 second=46 amount=-1 -kerning first=86 second=44 amount=-2 -kerning first=39 second=115 amount=-1 -kerning first=110 second=34 amount=-1 -kerning first=84 second=113 amount=-1 diff --git a/editor/assets/skin/roboto-dff.png b/editor/assets/skin/roboto-dff.png deleted file mode 100644 index df176132c..000000000 Binary files a/editor/assets/skin/roboto-dff.png and /dev/null differ diff --git a/editor/assets/skin/uiskin.atlas b/editor/assets/skin/uiskin.atlas index 35de00d31..ec66b5a1f 100644 --- a/editor/assets/skin/uiskin.atlas +++ b/editor/assets/skin/uiskin.atlas @@ -2,7 +2,7 @@ uiskin.png size: 2048,1024 format: RGBA8888 -filter: Linear,Linear +filter: Nearest,Nearest repeat: none background-fill rotate: false diff --git a/editor/assets/skin/uiskin.json b/editor/assets/skin/uiskin.json index 36d1ec73c..a2e842aff 100644 --- a/editor/assets/skin/uiskin.json +++ b/editor/assets/skin/uiskin.json @@ -1,5 +1,8 @@ { - + com.badlogic.gdx.graphics.g2d.BitmapFont: { + default-font: { file: skin/default-font.fnt }, + small-font: { file: skin/small-font.fnt } + }, com.badlogic.gdx.graphics.Color: { black: {a: 1, b: 0, g: 0, r: 0 } white: {a: 1, b: 1, g: 1, r: 1 } @@ -265,4 +268,4 @@ com.kotcrab.vis.ui.util.adapter.SimpleListAdapter$SimpleListAdapterStyle: { default: {background: window-bg, selection: list-selection } } -} +} \ No newline at end of file diff --git a/editor/src/com/rockbite/tools/talos/TalosLauncher.java b/editor/src/com/rockbite/tools/talos/TalosLauncher.java index f588e6d40..8f1fef35e 100644 --- a/editor/src/com/rockbite/tools/talos/TalosLauncher.java +++ b/editor/src/com/rockbite/tools/talos/TalosLauncher.java @@ -25,8 +25,6 @@ public static void main (String[] arg) { config.setWindowedMode(1200, 700); config.setTitle("Talos"); - config.setBackBufferConfig(8, 8, 8, 8, 16, 0, 16); - TalosMain talos = new TalosMain(); new Lwjgl3Application(talos, config); diff --git a/editor/src/com/rockbite/tools/talos/TalosMain.java b/editor/src/com/rockbite/tools/talos/TalosMain.java index 52e0e096f..f52fc1ff5 100644 --- a/editor/src/com/rockbite/tools/talos/TalosMain.java +++ b/editor/src/com/rockbite/tools/talos/TalosMain.java @@ -22,14 +22,7 @@ import com.badlogic.gdx.Preferences; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.BitmapFontCache; -import com.badlogic.gdx.graphics.g2d.DistanceFieldFont; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.utils.ObjectMap; import com.kotcrab.vis.ui.VisUI; @@ -141,27 +134,9 @@ public void run () { preferences = Gdx.app.getPreferences("talos-preferences"); TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("skin/uiskin.atlas")); - skin = new Skin(); + skin = new Skin(Gdx.files.internal("skin/uiskin.json")); skin.addRegions(atlas); - Texture fontTexture = new Texture(Gdx.files.internal("skin/roboto-dff.png"), true); - fontTexture.setFilter(Texture.TextureFilter.MipMapLinearNearest, Texture.TextureFilter.Linear); - DistanceFieldFont distanceFieldFont = new DistanceFieldFont(Gdx.files.internal("skin/roboto-dff.fnt"), new TextureRegion(fontTexture)) { - - @Override - public BitmapFontCache newFontCache () { - return new CustomCache(this, this.usesIntegerPositions()); - } - }; - distanceFieldFont.setDistanceFieldSmoothing(10); - distanceFieldFont.setUseIntegerPositions(true); - - skin.add("default-font", distanceFieldFont, BitmapFont.class); - skin.add("small-font", distanceFieldFont, BitmapFont.class); - - skin.load(Gdx.files.internal("skin/uiskin.json")); - - VisUI.load(skin); uiStage = new UIStage(skin); @@ -183,40 +158,6 @@ public BitmapFontCache newFontCache () { TalosMain.Instance().ProjectController().newProject(ProjectController.TLS); } - - static private class CustomCache extends BitmapFontCache { - - private final ShaderProgram distanceFieldShader; - - public CustomCache (DistanceFieldFont font, boolean integer) { - super(font, integer); - distanceFieldShader = DistanceFieldFont.createDistanceFieldShader(); - } - - private float getSmoothingFactor () { - final DistanceFieldFont font = (DistanceFieldFont)super.getFont(); - return font.getDistanceFieldSmoothing() * font.getScaleX(); - } - - @Override - public void draw (Batch spriteBatch) { - final ShaderProgram cache = spriteBatch.getShader(); - spriteBatch.setShader(distanceFieldShader); - spriteBatch.getShader().setUniformf("u_smoothing", getSmoothingFactor()); - super.draw(spriteBatch); - spriteBatch.setShader(cache); - } - - @Override - public void draw (Batch spriteBatch, int start, int end) { - final ShaderProgram cache = spriteBatch.getShader(); - spriteBatch.setShader(distanceFieldShader); - spriteBatch.getShader().setUniformf("u_smoothing", getSmoothingFactor()); - super.draw(spriteBatch, start, end); - spriteBatch.setShader(cache); - } - } - public void disableNodeStage() { currentWorkplaceStage = null; inputMultiplexer.removeProcessor(nodeStage.getStage());