Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.WidgetAnchor


      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;
      }
View Full Code Here


    GL11.glPushMatrix();

    double top = label.getScreenY();

    WidgetAnchor align = label.getAlign();
    if (align == WidgetAnchor.CENTER_LEFT || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.CENTER_RIGHT) {
      top -= (int) (label.isAuto() ? label.getActualHeight() : label.getHeight()) / 2;
    } else if (align == WidgetAnchor.BOTTOM_LEFT || align == WidgetAnchor.BOTTOM_CENTER || align == WidgetAnchor.BOTTOM_RIGHT) {
      top -= (int) (label.isAuto() ? label.getActualHeight() : label.getHeight());
    }
View Full Code Here

      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;
      }
View Full Code Here

TOP

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

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.