Package org.spout.api.math

Examples of org.spout.api.math.Rectangle


        popup.setGrabsMouse(false);

        // Setup the window to render
        RenderPartComponent backgroundRect = background.add(RenderPartComponent.class);
        backgroundRect.setRenderMaterial(type.getRenderMaterial());
        backgroundRect.setSprite(new Rectangle(-WIDTH * SCALE, -WIDTH, HEIGHT * 2 * SCALE, HEIGHT * 2));
        backgroundRect.setSource(new Rectangle(0, 0, WIDTH, HEIGHT));
        popup.attachWidget(plugin, background);

        // Draw title
        LabelComponent labelComponent = label.add(LabelComponent.class);
        labelComponent.setFont(VanillaRenderMaterials.FONT);
View Full Code Here


  public void init(Widget crosshair, HUD hud) {
    super.init(crosshair, hud);
    final RenderPartComponent crosshairRect = widget.add(RenderPartComponent.class);
    crosshairRect.setRenderMaterial(VanillaRenderMaterials.ICONS_MATERIAL);
    crosshairRect.setColor(Color.WHITE);
    crosshairRect.setSprite(new Rectangle(-0.0625f * SCALE, -0.0625f, 0.125f * SCALE, 0.125f));
    crosshairRect.setSource(new Rectangle(0f / 256f, 0f / 256f, 16f / 256f, 16f / 256f));

    attach();
  }
View Full Code Here

    float x = START_X;
    float dx = 0.06f * SCALE;
    for (int i = 0; i < 10; i++) {
      final RenderPart armorPart = new RenderPart();
      armorPart.setColor(Color.WHITE);
      armorPart.setSprite(new Rectangle(x, -0.7f, 0.06f * SCALE, 0.06f));
      armorPart.setSource(armorEmpty);
      armorPack.add(armorPart);
      x += dx;
    }

View Full Code Here

  public RenderItemStack(ItemStack item) {
    if (!(item.getMaterial() instanceof VanillaMaterial)) {
      throw new IllegalArgumentException("ItemStack must have a VanillaMaterial for a Material.");
    }
    this.item = item;
    setSource(new Rectangle(((VanillaMaterial) item.getMaterial()).getSpritePosition(), SOURCE_EXTENTS));
  }
View Full Code Here

  public Vector2f getPosition() {
    return pos;
  }

  public void setPosition(Vector2f pos) {
    setSprite(new Rectangle(pos, SPRITE_EXTENTS));
    this.pos = pos;
  }
View Full Code Here

      final RenderPartPacksComponent expRect = widget.add(RenderPartPacksComponent.class);
      expRect.add(expPack);

      final RenderPart expBgRect = new RenderPart();
      expBgRect.setColor(Color.WHITE);
      expBgRect.setSprite(new Rectangle(START_X, -0.82f, 1.81f * SCALE, 0.04f));
      expBgRect.setSource(new Rectangle(0, 64f / 256f, 0.91f, 0.019f));
      expPack.add(expBgRect);

      final RenderPart expBarRect = new RenderPart();
      expBarRect.setColor(Color.WHITE);
      expPack.add(expBarRect);

      final RenderPart rect = expPack.get(1);
      rect.setSprite(new Rectangle(START_X, -0.82f, 1.81f * SCALE * 0f, 0.04f));
      rect.setSource(new Rectangle(0, 69f / 256f, 182f / 256f * 0f, 5f / 256f));
    }

    attach();
  }
View Full Code Here

    return slot;
  }

  public void setPosition(Vector2f pos) {
    this.pos = pos;
    getOwner().setBounds(new Rectangle(pos, RenderItemStack.SPRITE_EXTENTS));
  }
View Full Code Here

  @Override
  public void update() {
    float percent = hud.getExpPercent();
    final RenderPart rect = expPack.get(1);
    rect.setSprite(new Rectangle(START_X, -0.82f, 1.81f * SCALE * percent, 0.04f));
    rect.setSource(new Rectangle(0, 69f / 256f, 182f / 256f * percent, 5f / 256f));
    widget.update();
  }
View Full Code Here

      System.out.println("Hovering");
      RenderPartPack boxPack = new RenderPartPack(SpoutRenderMaterials.GUI_COLOR);
      RenderPart box = new RenderPart();
      box.setZIndex(1);
      box.setColor(Color.RED);
      box.setSprite(new Rectangle(pos, RenderItemStack.SPRITE_EXTENTS));
      boxPack.add(box);
      parts.add(boxPack);
    }
    ItemStack item = slot.get();
    if (item != null) {
View Full Code Here

    float x = 0.09f * SCALE;
    float dx = 0.06f * SCALE;
    for (int i = 0; i < 10; i++) {
      final RenderPart bubble = new RenderPart();
      bubble.setColor(Color.WHITE);
      bubble.setSprite(new Rectangle(x, -0.69f, 0.06f * SCALE, 0.06f));
      bubble.setSource(bubbleFull);
      bubblePack.add(bubble);
      x += dx;
    }

View Full Code Here

TOP

Related Classes of org.spout.api.math.Rectangle

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.