Package org.spout.api.gui.render

Examples of org.spout.api.gui.render.RenderPartPack


  public List<RenderPartPack> getRenderPartPacks() {
    List<RenderPartPack> parts = new ArrayList<RenderPartPack>();
    System.out.println("Getting render parts");
    if (hovered) {
      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) {
      System.out.println("Item not null");
      RenderPartPack itemPack = new RenderPartPack(VanillaRenderMaterials.ITEMS_MATERIAL);
      RenderItemStack itemPart = new RenderItemStack(item);
      itemPart.setZIndex(2);
      itemPart.setPosition(pos);
      itemPack.add(itemPart);
      parts.add(itemPack);
    }
    return parts;
  }
View Full Code Here


      float x = START_X;
      float dx = 0.06f * SCALE;

      // Health bar
      final RenderPartPacksComponent heartsRect = hearts.add(RenderPartPacksComponent.class);
      final RenderPartPack hearts_pack = new RenderPartPack(VanillaRenderMaterials.ICONS_MATERIAL);
      float y = VanillaConfiguration.HARDCORE_MODE.getBoolean() ? 45f / 256f : 0;
      for (int i = 0; i < 10; i++) {
        final RenderPart heart = new RenderPart();
        heart.setColor(Color.WHITE);
        heart.setSprite(new org.spout.api.math.Rectangle(x + 0.005f, -0.77f, 0.065f * SCALE, 0.065f));
        heart.setSource(new org.spout.api.math.Rectangle(53f / 256f, y, 9f / 256f, 9f / 256f));
        hearts_pack.add(heart);
        x += dx;
      }

      x = START_X;
      for (int i = 0; i < 10; i++) {
        final RenderPart heartBg = new RenderPart();
        heartBg.setColor(Color.WHITE);
        heartBg.setSprite(new org.spout.api.math.Rectangle(x, -0.77f, 0.065f * SCALE, 0.065f));
        heartBg.setSource(new org.spout.api.math.Rectangle(16f / 256f, y, 9f / 256f, 9f / 256f));
        hearts_pack.add(heartBg);
        x += dx;
      }

      heartsRect.add(hearts_pack);

View Full Code Here

TOP

Related Classes of org.spout.api.gui.render.RenderPartPack

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.