diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-08 06:15:31 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-08 06:15:31 +0100 |
commit | 7648047a45a4df146094540709daa46fff90d29d (patch) | |
tree | 69f016384db342b469e6b7b1dd920596ec0fcee8 /core/src/ch/asynk/rustanddust/ui | |
parent | 021fa2ace9b61af6c962f3911991c893ea554e8e (diff) | |
download | RustAndDust-7648047a45a4df146094540709daa46fff90d29d.zip RustAndDust-7648047a45a4df146094540709daa46fff90d29d.tar.gz |
ui/Menu: improve enum API, so that it can write Labels itself
Diffstat (limited to 'core/src/ch/asynk/rustanddust/ui')
-rw-r--r-- | core/src/ch/asynk/rustanddust/ui/Menu.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/ui/Menu.java b/core/src/ch/asynk/rustanddust/ui/Menu.java index 2fe93a7..78f5964 100644 --- a/core/src/ch/asynk/rustanddust/ui/Menu.java +++ b/core/src/ch/asynk/rustanddust/ui/Menu.java @@ -15,6 +15,8 @@ public class Menu extends Patch { public int last(); public int i(); + public String s(); + public MenuItem get(int i); }; protected MenuItem menuItem; @@ -24,8 +26,10 @@ public class Menu extends Patch super(ninePatch); this.menuItem = menuItem; this.labels = new Label[menuItem.last()]; - for (int i = 0; i< menuItem.last(); i ++) + for (int i = 0; i< menuItem.last(); i ++) { labels[i] = new Label(font, 10); + labels[i].write(menuItem.get(i).s()); + } } protected Label label(MenuItem m) |