Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.Color


  }

  @Override
  public void updateScreen() {
    if (model.isPolling()) {
      Color color = new Color(0, 0f, 0);
      double darkness = 0;
      long t = System.currentTimeMillis() % 1000;
      darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2;
      color.setBlue(1f - (float) darkness);
      if (model.isPolling()) {
        buttonRefresh.setDisabledColor(color);
      }

      // If polling locks up and takes > 15s, unlock the button
View Full Code Here


  @Override
  public void onButtonClick() {
    Configuration.setAutomatePerformance(true);
    Configuration.setAutomateMode(1);
    Configuration.write();
    label.setTextColor(new Color(1F, 1F, 1F, 1F));
  }
View Full Code Here

      return Color.invalid();
    }
    if ((flags & FLAG_COLOROVERRIDE) > 0) {
      return Color.override();
    }
    return new Color(argb);
  }
View Full Code Here

  @Override
  public void onButtonClick() {
    Configuration.setAutomatePerformance(true);
    Configuration.setAutomateMode(0);
    Configuration.write();
    label.setTextColor(new Color(1F, 1F, 1F, 1F));
  }
View Full Code Here

  @Override
  public void onButtonClick() {
    Configuration.setAutomatePerformance(true);
    Configuration.setAutomateMode(2);
    Configuration.write();
    label.setTextColor(new Color(1F, 1F, 1F, 1F));
  }
View Full Code Here

    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);

    int top = 5;

    Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F);

    label = new GenericLabel("Controls and Audio Settings");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
View Full Code Here

    if (!Configuration.isAdvancedOptions()) {
      Configuration.setAdvancedOptions(true);
      SpoutClient.getHandle().displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(parent));
    }
    Configuration.write();
    label.setTextColor(new Color(0.45F, 0.45F, 0.45F, 0.45F));
  }
View Full Code Here

    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);

    int top = 5;

    Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F);

    // Controls and audio
    label = new GenericLabel("Controls and Audio Settings");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
View Full Code Here

      String text = getFittingText(button.getText(), (int) button.getInnerWidth());

      int hoverState = getHoverState(button, isHovering(button));
      RenderUtil.drawTexturedModalRectangle(0, 0, 0, 46 + hoverState * 20, (int) Math.ceil(width / 2), 20, 0f);
      RenderUtil.drawTexturedModalRectangle((int) Math.floor(width / 2), 0, 200 - (int) Math.ceil(width / 2), 46 + hoverState * 20, (int) Math.ceil(width / 2), 20, 0f);
      Color color = getColor(button);

      int left = 5;
      WidgetAnchor align = button.getAlign();
      if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) {
        left = (int) ((width / 2) - (font.getStringWidth(text) / 2));
      } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) {
        left = (int) (width - font.getStringWidth(text)) - 5;
      }

      GL11.glPushMatrix();
      float scale = button.getScale();
      GL11.glScalef(scale, scale, scale);
      font.drawStringWithShadow(text, left, 6, color.toInt());
      GL11.glPopMatrix();
    }
  }
View Full Code Here

      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      width -= 8;
      RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width), 0, 0, 66, 4, 20, 0f);
      RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width) + 4, 0, 196, 66, 4, 20, 0f);

      Color color = slider.getTextColor();
      if (!slider.isEnabled()) {
        color = slider.getDisabledColor();
      }

      int left = 5;
      WidgetAnchor align = slider.getAlign();
      if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) {
        left = (int) ((width / 2) - (font.getTextWidth(slider.getText()) / 2));
      } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) {
        left = (int) (width - font.getTextWidth(slider.getText())) - 5;
      }

      GL11.glPushMatrix();
      float scale = slider.getScale();
      GL11.glScalef(scale, scale, scale);
      font.drawString(slider.getText(), left, 6, color.toInt());
      GL11.glPopMatrix();
    }
  }
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.gui.Color

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.