diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-18 11:10:21 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-18 11:10:21 +0100 |
commit | cb81f0a8a194ceebaea880f9027635e6a27df69e (patch) | |
tree | a64e55aaa5f45d8329737af6633a6d3fe9f3a3ff /core/src/ch/asynk/rustanddust/ui | |
parent | 75ff89304eaf9052ab889bb7ec81c96de4fa7908 (diff) | |
download | RustAndDust-cb81f0a8a194ceebaea880f9027635e6a27df69e.zip RustAndDust-cb81f0a8a194ceebaea880f9027635e6a27df69e.tar.gz |
UI: merge menu and ui assets, AtlasRegion are known and provided by RustAndDust
Diffstat (limited to 'core/src/ch/asynk/rustanddust/ui')
-rw-r--r-- | core/src/ch/asynk/rustanddust/ui/Msg.java | 8 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/ui/OkCancel.java | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/core/src/ch/asynk/rustanddust/ui/Msg.java b/core/src/ch/asynk/rustanddust/ui/Msg.java index e1e7c13..16c4e2d 100644 --- a/core/src/ch/asynk/rustanddust/ui/Msg.java +++ b/core/src/ch/asynk/rustanddust/ui/Msg.java @@ -2,17 +2,17 @@ package ch.asynk.rustanddust.ui; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.g2d.NinePatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public class Msg extends Patch { private LabelStack label; - public Msg(BitmapFont font, TextureAtlas atlas) + public Msg(BitmapFont font, NinePatch patch, float fontSize) { - super(atlas.createPatch("typewriter")); - label = new LabelStack(font, 20f); + super(patch); + label = new LabelStack(font, fontSize); } @Override diff --git a/core/src/ch/asynk/rustanddust/ui/OkCancel.java b/core/src/ch/asynk/rustanddust/ui/OkCancel.java index c064102..7b0bd1c 100644 --- a/core/src/ch/asynk/rustanddust/ui/OkCancel.java +++ b/core/src/ch/asynk/rustanddust/ui/OkCancel.java @@ -1,8 +1,9 @@ package ch.asynk.rustanddust.ui; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.NinePatch; import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public class OkCancel extends Patch @@ -16,12 +17,12 @@ public class OkCancel extends Patch protected Bg okBtn; protected Bg cancelBtn; - public OkCancel(BitmapFont font, TextureAtlas atlas) + public OkCancel(BitmapFont font, NinePatch patch, AtlasRegion okRegion, AtlasRegion cancelRegion) { - super(atlas.createPatch("typewriter")); + super(patch); this.label = new Label(font); - this.okBtn = new Bg(atlas.findRegion("ok")); - this.cancelBtn = new Bg(atlas.findRegion("cancel")); + this.okBtn = new Bg(okRegion); + this.cancelBtn = new Bg(cancelRegion); this.visible = false; } |