コード例 #1
0
ファイル: ShopState.java プロジェクト: Alagris/FastClicker
 @Override
 public void createState(FastClicker mainClass) {
   this.mainClass = mainClass;
   float w = FastClicker.WIDTH / 7;
   float h = w / 2;
   animatedText =
       new AnimatedText(
           StaticBitmapFont.getBitmapFont(),
           0,
           h * 2.5f,
           FastClicker.WIDTH,
           StaticBitmapFont.getSpriteBatch(),
           1f);
   buttonExit = new ButtonSquare(w, 0, w * 2, h * 2, RectangleRenderer.getWHITE_PIXEL(), "Exit");
   buttonBuy = new ButtonSquare(w * 4, 0, w * 2, h * 2, RectangleRenderer.getWHITE_PIXEL(), "Buy");
   buttonNext =
       new ButtonSquare(w * 5, h * 3, w * 2, h * 2, RectangleRenderer.getWHITE_PIXEL(), "Next");
   buttonPrevious =
       new ButtonSquare(0, h * 3, w * 2, h * 2, RectangleRenderer.getWHITE_PIXEL(), "Back");
   heartsPanel = new ShopStateHearts(this);
   goldPanel = new ShopStateGold(this);
   freeGoldPanel = new ShopStateGoldFree(this);
   gamemodePanel = new ShopStateGamemode(this);
   panels = new ShopStatePanelInterface[] {heartsPanel, goldPanel, freeGoldPanel, gamemodePanel};
   animatedText.setText("not enough gold", Color.RED);
   playerGoldValueGlyph = new GlyphLayout();
   playerGoldTextGlyph = new GlyphLayout(StaticBitmapFont.getBitmapFont(), "Your gold:");
   goldTextX = (int) ((FastClicker.WIDTH - playerGoldTextGlyph.width) / 2);
   goldTextY = (int) (h * 5);
   goldNumberY = (int) (h * 4);
 }
コード例 #2
0
ファイル: ShopState.java プロジェクト: Alagris/FastClicker
 public void setErrorText(String text) {
   if (text == null) return;
   animatedText.setText(text, Color.RED);
 }