Package com.mojang.minecraft.gui

Examples of com.mojang.minecraft.gui.Button


public final class PauseScreen extends GuiScreen {

   public final void onOpen() {
      this.buttons.clear();
      this.buttons.add(new Button(0, this.width / 2 - 100, this.height / 4, "Options..."));
      this.buttons.add(new Button(1, this.width / 2 - 100, this.height / 4 + 24, "Generate new level..."));
      this.buttons.add(new Button(2, this.width / 2 - 100, this.height / 4 + 48, "Save level.."));
      this.buttons.add(new Button(3, this.width / 2 - 100, this.height / 4 + 72, "Load level.."));
      this.buttons.add(new Button(4, this.width / 2 - 100, this.height / 4 + 120, "Back to game"));
      if(this.minecraft.session == null) {
         ((Button)this.buttons.get(2)).active = false;
         ((Button)this.buttons.get(3)).active = false;
      }
View Full Code Here


public final class GameOverScreen extends GuiScreen {

   public final void onOpen() {
      this.buttons.clear();
      this.buttons.add(new Button(1, this.width / 2 - 100, this.height / 4 + 72, "Generate new level..."));
      this.buttons.add(new Button(2, this.width / 2 - 100, this.height / 4 + 96, "Load level.."));
      if(this.minecraft.session == null) {
         ((Button)this.buttons.get(2)).active = false;
      }

   }
View Full Code Here

   public void onOpen() {
      (new Thread(this)).start();

      for(int var1 = 0; var1 < 5; ++var1) {
         this.buttons.add(new Button(var1, this.width / 2 - 100, this.height / 6 + var1 * 24, "---"));
         ((Button)this.buttons.get(var1)).visible = false;
         ((Button)this.buttons.get(var1)).active = false;
      }

      this.buttons.add(new Button(5, this.width / 2 - 100, this.height / 6 + 120 + 12, "Load file..."));
      this.buttons.add(new Button(6, this.width / 2 - 100, this.height / 6 + 168, "Cancel"));
   }
View Full Code Here

   }

   public final void onOpen() {
      this.buttons.clear();
      Keyboard.enableRepeatEvents(true);
      this.buttons.add(new Button(0, this.width / 2 - 100, this.height / 4 + 120, "Save"));
      this.buttons.add(new Button(1, this.width / 2 - 100, this.height / 4 + 144, "Cancel"));
      ((Button)this.buttons.get(0)).active = this.name.trim().length() > 1;
   }
View Full Code Here

   public final void onOpen() {
      for(int var1 = 0; var1 < this.settings.bindings.length; ++var1) {
         this.buttons.add(new OptionButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.settings.getBinding(var1)));
      }

      this.buttons.add(new Button(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
   }
View Full Code Here

      this.parent = var1;
   }

   public final void onOpen() {
      this.buttons.clear();
      this.buttons.add(new Button(0, this.width / 2 - 100, this.height / 4, "Small"));
      this.buttons.add(new Button(1, this.width / 2 - 100, this.height / 4 + 24, "Normal"));
      this.buttons.add(new Button(2, this.width / 2 - 100, this.height / 4 + 48, "Huge"));
      this.buttons.add(new Button(3, this.width / 2 - 100, this.height / 4 + 120, "Cancel"));
   }
View Full Code Here

   public final void onOpen() {
      for(int var1 = 0; var1 < this.settings.settingCount; ++var1) {
         this.buttons.add(new OptionButton(var1, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), this.settings.getSetting(var1)));
      }

      this.buttons.add(new Button(100, this.width / 2 - 100, this.height / 6 + 120 + 12, "Controls..."));
      this.buttons.add(new Button(200, this.width / 2 - 100, this.height / 6 + 168, "Done"));
   }
View Full Code Here

   protected FontRenderer fontRenderer;


   public void render(int var1, int var2) {
      for(int var3 = 0; var3 < this.buttons.size(); ++var3) {
         Button var10000 = (Button)this.buttons.get(var3);
         Minecraft var7 = this.minecraft;
         Button var4 = var10000;
         if(var10000.visible) {
            FontRenderer var8 = var7.fontRenderer;
            GL11.glBindTexture(3553, var7.textureManager.load("/gui/gui.png"));
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            byte var9 = 1;
            boolean var6 = var1 >= var4.x && var2 >= var4.y && var1 < var4.x + var4.width && var2 < var4.y + var4.height;
            if(!var4.active) {
               var9 = 0;
            } else if(var6) {
               var9 = 2;
            }

            var4.drawImage(var4.x, var4.y, 0, 46 + var9 * 20, var4.width / 2, var4.height);
            var4.drawImage(var4.x + var4.width / 2, var4.y, 200 - var4.width / 2, 46 + var9 * 20, var4.width / 2, var4.height);
            if(!var4.active) {
               Button.drawCenteredString(var8, var4.text, var4.x + var4.width / 2, var4.y + (var4.height - 8) / 2, -6250336);
            } else if(var6) {
               Button.drawCenteredString(var8, var4.text, var4.x + var4.width / 2, var4.y + (var4.height - 8) / 2, 16777120);
            } else {
View Full Code Here

   }

   protected void onMouseClick(int var1, int var2, int var3) {
      if(var3 == 0) {
         for(var3 = 0; var3 < this.buttons.size(); ++var3) {
            Button var4;
            Button var7;
            if((var7 = var4 = (Button)this.buttons.get(var3)).active && var1 >= var7.x && var2 >= var7.y && var1 < var7.x + var7.width && var2 < var7.y + var7.height) {
               this.onButtonClick(var4);
            }
         }
      }
View Full Code Here

TOP

Related Classes of com.mojang.minecraft.gui.Button

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.