From bf44ad78c9d6a4b260277ffc21c811ae4ce3474f Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Sat, 16 May 2015 21:44:29 +0300 Subject: [PATCH] Added buttons in code & tweaked GUI interactive nodes. --- core/assets/sprites/buttons/play.png | Bin 1942 -> 0 bytes core/assets/sprites/buttons/playHover.png | Bin 2101 -> 0 bytes .../gui/creators/MainMenuGUICreator.java | 8 +++++--- .../saltosion/gladiator/input/InputHandler.java | 2 +- core/src/com/saltosion/gladiator/util/Name.java | 8 ++++++-- .../saltosion/gladiator/util/SpriteLoader.java | 8 ++++++-- 6 files changed, 18 insertions(+), 8 deletions(-) delete mode 100644 core/assets/sprites/buttons/play.png delete mode 100644 core/assets/sprites/buttons/playHover.png diff --git a/core/assets/sprites/buttons/play.png b/core/assets/sprites/buttons/play.png deleted file mode 100644 index 5b0b50f033faf9ef89e5036c51aae9ed694a8ea5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1942 zcmeHH`#;lr82`+M+4dcq*=9F0Y%Yt1VRPLwnp@h2iBpD!QYa^0idK#;j*f^55#c1& zx}4;6x+#_N%B7rADczaZOVLH@&~d)!&p5Bwd0y}5c|Xtd!}G)Y^*qn+=%`Q#L&E?7 zAoGJa?7YSp03?WxP|4svoTCB2 z!DEboISN>yfTbxQnF2Bz27-(>qG1r$SR@sTqT`SZtPule#DY*v$k-N-;#inC5KQd} zXdVfM8IOeFks(JC+S$s?iHva~V_hgXX9~op;9RWnu2ifm6}N~AxzQj26)T`YLOR}) zVeZ2;_h49fF)f5F7zA${qR_@t#Ig{x2_iO8#I_XKlEfU6*v`tIL-gZV`f*79aBfEq zb0>3;TW{2eM&BWf~LuzLU7e_8=y|0j6!fm!y__>BPIyZ?1WPgYwh+@$8p)Va#6 z)wy|^4O)<`$ylH3x?Y>h_H-4v3biHfTKI_OI!(m@Vx8)Vv zF9}(iGQ{!L7Z(b$dTzx)FFs$tZpu&B->mLfgY1)u%#viq{Gy}f^;d%59mYbZzF2jf zs?O)dKo-oi2?r*o;u15e6?Wd;9~?&pc5U!d;z9C`vdzIMrOyZF<@Lro#@PcSpFU58 z==i|xpM-nz=B7)&v!7g0t*Kdj zzFL{tpkJYjuT^JHYEcJMCN%+PxHtS0<|=O01&?*0>G$t$$l1B5v=`lGdfO<-)lfxG zgoh3Az@`1qPrn&1*9hu3xCsmC?Q@&`y_Dlu@j;=00M54rAaq_yO(R8N0sFE?yBp^- z=fs;`QVPUB3?Z_AnLBq^NS8st(X!rnUTbkCzc z^z;#G-Gd3gmWH;Kk8+-lx-``(RIzKty1;-m=I*M}gN{h`15KUN_+^{huYW$+oJrWe zzfvM-AIt^e0|udV)xAZHKY0+}zo0-3v(<)5Ev|c;(#fINO5Yq)@+-2dm}s-4n&Xn! z0~}GqSn;9!Z%=aa%F>&a{c7GZlcap;?X(05i1(ZIFwLJ2rw{ zyVKv~;JTDe+wN}d3LsrON*K`eR-QH{ytq??IMV%c247e}-*hImSr}#9`AV!$OU&Kk z9T3@F^d=W&eltD=fU4ow?Tv<1-$gC_FIPNb$9=x8CckGXrkx4rFt1IySw}7u;K8A> zMBf{STE6;uUwnLR%>Cl2lL6A%k3|uk)RsS*a$4%Wzd@dH?WEScdNF$ zzAutgob#yWis6z(m!GxpbY$6V-e}DJVu=v2jHlW-+~qO+rg=kxvm!;bCDGwxQl!=5 zjOKw0kT{bC Yqf2G=*-?omUGS>_a#>WcUYfN1A7Q#WX8-^I diff --git a/core/assets/sprites/buttons/playHover.png b/core/assets/sprites/buttons/playHover.png deleted file mode 100644 index dc5d64b005393b7a04d1f18063f435e827fc7a2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2101 zcmeHH>01+a68?p7C*exS#gzad5Dq~SA&^LboFp8Eqak1bK{-Sc2%vJra423Jg0dj> z0R_~Gx}udlg$ckDK;(}?rI;51F5Y&0ZYYei!=u9i=x>CrW|#l~1#zMTjzKr% z<^aGAZH$1mF|aWPNHc&k188#tAZT+Vyd?w&g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V(V&%TSs5iCsiBuh80b z%>+EyKZ)}Ozv?5QAz#Sa@XcE4%7Xtf_Dws!I&;Xh$>Qm*J-eSzPEW-uZ>*|!j_UvU z-K)o&m8mmIT`#mJD7$CFhqp^mv&8fI7fhl%`3lXdljFS-x+(mFpxYBp7>VSzI<%+R_3 zGc@tEu>=HRQwHgegfeAnHtx~q79(KxW@lvjgEv1!tP$EO>1MyB+}NlbX}ngmY&7)` z!s$gV(TdpkC+NM}{S(h53C!U#uKR)X$a(%HYY2Lbg)y2df2*3-or5)Tfd1Tp4k4XS znrAgUl6ay*n8j^P_ew{6eHswfyj!EPk=vX*+WeWfj~*ghU@e(9u5D!9Zyel=7?@kG zum4x`i~kJh^o4Az=_u7lQU!%OVsq)2Iu%6GLwfS?`@(ms0oKy$v*!;!hVDUatvI?^ zZP}0++Qu7{;bQfqrz5WCKdZ9W7N6hxu(>vIaR0cX^p$kO(BR;p%%>nf-}hkLH|Em1 w{`~i|k6unq9}{9e2X%bIQGbakM>I{WLis}`Z`aBL=Kp?o0!|G3VnllNU)*)cb^rhX diff --git a/core/src/com/saltosion/gladiator/gui/creators/MainMenuGUICreator.java b/core/src/com/saltosion/gladiator/gui/creators/MainMenuGUICreator.java index 7cb28c6..876e927 100644 --- a/core/src/com/saltosion/gladiator/gui/creators/MainMenuGUICreator.java +++ b/core/src/com/saltosion/gladiator/gui/creators/MainMenuGUICreator.java @@ -3,7 +3,6 @@ package com.saltosion.gladiator.gui.creators; import com.saltosion.gladiator.gui.nodes.ButtonNode; import com.saltosion.gladiator.gui.nodes.TextNode; import com.saltosion.gladiator.util.AppUtil; -import com.saltosion.gladiator.util.Log; import com.saltosion.gladiator.util.Name; import com.saltosion.gladiator.util.SpriteLoader; @@ -17,8 +16,8 @@ public class MainMenuGUICreator implements GUICreator { titleText.setPosition(0.23f, 0.8f); AppUtil.guiManager.getRootNode().addChild(titleText); - ButtonNode playButton = new ButtonNode("Play Button", SpriteLoader.loadSprite(Name.BUTTON_PLAY_HOVER), - SpriteLoader.loadSprite(Name.BUTTON_PLAY)) { + ButtonNode playButton = new ButtonNode("Play Button", SpriteLoader.loadSprite(Name.BUTTON_BIG), + SpriteLoader.loadSprite(Name.BUTTON_BIG_HOVER)) { @Override public void pressed(int x, int y, int mouseButton) { } @@ -29,6 +28,9 @@ public class MainMenuGUICreator implements GUICreator { } }; playButton.setPosition(0.5f, 0.5f); + TextNode playButtonText = new TextNode("Play Button Text", "Play"); + playButtonText.setPosition(-0.0325f, 0.0175f); + playButton.addChild(playButtonText); AppUtil.guiManager.getRootNode().addChild(playButton); } diff --git a/core/src/com/saltosion/gladiator/input/InputHandler.java b/core/src/com/saltosion/gladiator/input/InputHandler.java index e98757c..b05a6c4 100644 --- a/core/src/com/saltosion/gladiator/input/InputHandler.java +++ b/core/src/com/saltosion/gladiator/input/InputHandler.java @@ -104,7 +104,7 @@ public class InputHandler implements InputProcessor { float x1 = node.getPosition().x + width / 2; float y0 = node.getPosition().y - height / 2; float y1 = node.getPosition().y + height / 2; - x += 0.01f; + x += 0.0065f; if (node instanceof InteractiveProperty) { InteractiveProperty interactiveNode = (InteractiveProperty) node; diff --git a/core/src/com/saltosion/gladiator/util/Name.java b/core/src/com/saltosion/gladiator/util/Name.java index a881e16..1a88ccb 100644 --- a/core/src/com/saltosion/gladiator/util/Name.java +++ b/core/src/com/saltosion/gladiator/util/Name.java @@ -11,8 +11,12 @@ public class Name { public static final String WALLIMG = "WALLIMG"; public static final String SWINGHITBOXIMG = "SWINGHITBOXIMG"; - public static final String BUTTON_PLAY = "BUTTON_PLAY"; - public static final String BUTTON_PLAY_HOVER = "BUTTON_PLAY_HOVER"; + public static final String BUTTON_HUGE = "BUTTON_HUGE"; + public static final String BUTTON_HUGE_HOVER = "BUTTON_HUGE_HOVER"; + public static final String BUTTON_BIG = "BUTTON_BIG"; + public static final String BUTTON_BIG_HOVER = "BUTTON_BIG_HOVER"; + public static final String BUTTON_SMALL = "BUTTON_SMALL"; + public static final String BUTTON_SMALL_HOVER = "BUTTON_SMALL_HOVER"; public static final String MOVE_LEFT = "MOVE_LEFT"; public static final String MOVE_RIGHT = "MOVE_RIGHT"; diff --git a/core/src/com/saltosion/gladiator/util/SpriteLoader.java b/core/src/com/saltosion/gladiator/util/SpriteLoader.java index 9bfa6bd..eab96d1 100644 --- a/core/src/com/saltosion/gladiator/util/SpriteLoader.java +++ b/core/src/com/saltosion/gladiator/util/SpriteLoader.java @@ -17,8 +17,12 @@ public class SpriteLoader { loadTexture(Name.GROUNDIMG, "sprites/ground.png"); loadTexture(Name.WALLIMG, "sprites/wall.png"); loadTexture(Name.SWINGHITBOXIMG, "sprites/swinghitbox.png"); - loadTexture(Name.BUTTON_PLAY, "sprites/buttons/play.png"); - loadTexture(Name.BUTTON_PLAY_HOVER, "sprites/buttons/playHover.png"); + loadTexture(Name.BUTTON_HUGE, "sprites/buttons/Button_Huge.png"); + loadTexture(Name.BUTTON_HUGE_HOVER, "sprites/buttons/Button_Huge_Hover.png"); + loadTexture(Name.BUTTON_BIG, "sprites/buttons/Button_Big.png"); + loadTexture(Name.BUTTON_BIG_HOVER, "sprites/buttons/Button_Big_Hover.png"); + loadTexture(Name.BUTTON_SMALL, "sprites/buttons/Button_Small.png"); + loadTexture(Name.BUTTON_SMALL_HOVER, "sprites/buttons/Button_Small_Hover.png"); } /**