当前位置: 首页>>代码示例>>Java>>正文


Java IWidgetIcon类代码示例

本文整理汇总了Java中com.enderio.core.api.client.render.IWidgetIcon的典型用法代码示例。如果您正苦于以下问题:Java IWidgetIcon类的具体用法?Java IWidgetIcon怎么用?Java IWidgetIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IWidgetIcon类属于com.enderio.core.api.client.render包,在下文中一共展示了IWidgetIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderStdTab

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public @Nonnull Rectangle renderStdTab(int sx, int sy, int tabNo, @Nonnull ItemStack stack, @Nullable IWidgetIcon icon, @Nullable GuiButton button,
    boolean isActive) {
  int tabX = sx + xSize + -3;
  int tabY = sy + 4 + 24 * tabNo;

  Rectangle result = renderTab(tabX, tabY, 24, stack, icon, isActive);

  while (tabAreas.size() <= tabNo) {
    tabAreas.add(NO_TAB);
  }
  tabAreas.set(tabNo, result);

  if (button != null) {
    button.xPosition = result.x;
    button.yPosition = result.y;
    button.width = result.width;
    button.height = result.height;
    button.enabled = !isActive;
  }

  GlStateManager.color(1, 1, 1, 1);
  return result;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:24,代码来源:GuiContainerBaseEIO.java

示例2: CustomWidgetIcon

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public CustomWidgetIcon(int x, int y, int width, int height, IWidgetMap map, IWidgetIcon overlay) {
  this.x = x;
  this.y = y;
  this.width = width;
  this.height = height;
  this.map = map;
  this.overlay = overlay;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:9,代码来源:CustomWidgetIcon.java

示例3: MultiIconButton

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public MultiIconButton(IGuiScreen gui, int id, int x, int y, IWidgetIcon unpressed, IWidgetIcon pressed, IWidgetIcon hover) {
  super(gui, id, x, y, null);
  this.unpressed = unpressed;
  this.pressed = pressed;
  this.hover = hover;
  setSize((int) unpressed.getWidth(), (int) unpressed.getHeight());
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:8,代码来源:MultiIconButton.java

示例4: getIconForHoverState

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
@Override
protected IWidgetIcon getIconForHoverState(int hoverState) {
  if (hoverState == 0) {
    return pressed;
  }
  if (hoverState == 2) {
    return hover;
  }
  return unpressed;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:11,代码来源:MultiIconButton.java

示例5: IconButton

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public IconButton(IGuiScreen gui, int id, int x, int y, IWidgetIcon icon) {
  super(id, x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT, "");
  this.gui = gui;
  this.icon = icon;
  this.xOrigin = x;
  this.yOrigin = y;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:8,代码来源:IconButton.java

示例6: drawButton

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
/**
 * Draws this button to the screen.
 */
@SuppressWarnings("synthetic-access")
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
  if (toolTip != null) {
    toolTip.setVisible(visible);
  }
  if (visible) {

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + width && mouseY < this.yPosition + height;
    int hoverState = getHoverState(this.field_146123_n);
    mouseDragged(mc, mouseX, mouseY);

    IWidgetIcon background = getIconForHoverState(hoverState);

    GL11.glColor3f(1, 1, 1);

    int x = xPosition;
    int y = yPosition;

    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    background.getMap().render(background, x, y, width, height, 0, true);
    if (icon != null) {
      icon.getMap().render(icon, x + marginX, y + marginY, width - (2 * marginX), height - (2 * marginY), 0, true);
    }

    GL11.glPopAttrib();

  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:37,代码来源:IconButton.java

示例7: getIconForHoverState

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
protected IWidgetIcon getIconForHoverState(int hoverState) {
  if (hoverState == 0) {
    return EnderWidget.BUTTON_DISABLED;
  }
  if (hoverState == 2) {
    return EnderWidget.BUTTON_HIGHLIGHT;
  }
  return EnderWidget.BUTTON;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:10,代码来源:IconButton.java

示例8: ToggleButton

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public ToggleButton(IGuiScreen gui, int id, int x, int y, IWidgetIcon unselectedIcon, IWidgetIcon selectedIcon) {
  super(gui, id, x, y, unselectedIcon);
  this.unselectedIcon = unselectedIcon;
  this.selectedIcon = selectedIcon;
  selected = false;
  paintSelectionBorder = true;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:8,代码来源:ToggleButton.java

示例9: getIconForHoverState

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
@Override
protected IWidgetIcon getIconForHoverState(int hoverState) {
  if (!selected || !paintSelectionBorder) {
    return super.getIconForHoverState(hoverState);
  }
  if (hoverState == 0) {
    return EnderWidget.BUTTON_DISABLED;
  }
  if (hoverState == 2) {
    return EnderWidget.BUTTON_DOWN_HIGHLIGHT;
  }
  return EnderWidget.BUTTON_DOWN;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:14,代码来源:ToggleButton.java

示例10: addIcon

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
private static IProbeInfo addIcon(IProbeInfo probeInfo, IWidgetIcon icon, int border) {
  ResourceLocation texture = icon.getMap().getTexture();
  int x = icon.getX();
  int y = icon.getY();
  int width = icon.getWidth();
  int height = icon.getHeight();

  return probeInfo.icon(texture, x, y, width, height, probeInfo.defaultIconStyle().width(width + border).height(height + border));
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:10,代码来源:TOPCompatibility.java

示例11: renderTab

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public @Nonnull Rectangle renderTab(int x, int y, int w, @Nonnull ItemStack stack, @Nullable IWidgetIcon icon, boolean isActive) {
  int bg_x = isActive ? 0 : 3;
  int bg_w = w - 3 - bg_x;
  int l_x = isActive ? 0 : 3;
  int l_w = w - 3 - l_x;
  int r_x = 3;
  int r_w = w - r_x;
  int r_u = IconEIO.TAB_FRAME_LEFT.width - r_w;

  if (isActive) {
    GlStateManager.color(1, 1, 1, 1);
  } else {
    GlStateManager.color(.9f, .9f, .9f, 1);
  }

  VertexBuffer tes = Tessellator.getInstance().getBuffer();
  RenderUtil.bindTexture(IconEIO.map.getTexture());
  tes.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);

  renderTabPart(tes, x + bg_x, y, IconEIO.TAB_BG.getX() + bg_x, IconEIO.TAB_BG.getY(), bg_w, IconEIO.TAB_BG.getHeight());
  renderTabPart(tes, x + l_x, y, IconEIO.TAB_FRAME_LEFT.getX() + l_x, IconEIO.TAB_FRAME_LEFT.getY(), l_w, IconEIO.TAB_FRAME_LEFT.getHeight());
  renderTabPart(tes, x + r_x, y, IconEIO.TAB_FRAME_RIGHT.getX() + r_u, IconEIO.TAB_FRAME_RIGHT.getY(), r_w, IconEIO.TAB_FRAME_RIGHT.getHeight());

  if (icon != null) {
    icon.getMap().render(icon, x + w / 2 - 8, y + IconEIO.TAB_BG.getHeight() / 2 - 8, false);
  }
  Tessellator.getInstance().draw();

  if (Prep.isValid(stack)) {
    RenderHelper.enableGUIStandardItemLighting();
    itemRender.renderItemIntoGUI(stack, x + w / 2 - 8, y + IconEIO.TAB_BG.getHeight() / 2 - 8);
    RenderHelper.disableStandardItemLighting();
  }

  return new Rectangle(x + bg_x, y - 1, bg_w + 3 + 1, IconEIO.TAB_BG.getHeight() + 2);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:37,代码来源:GuiContainerBaseEIO.java

示例12: getOverlay

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
@Override
public IWidgetIcon getOverlay() {
  return overlay;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:5,代码来源:CustomWidgetIcon.java

示例13: getIcon

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public IWidgetIcon getIcon() {
  return icon;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:4,代码来源:IconButton.java

示例14: setIcon

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public void setIcon(IWidgetIcon icon) {
  this.icon = icon;
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:4,代码来源:IconButton.java

示例15: drawScrollbar

import com.enderio.core.api.client.render.IWidgetIcon; //导入依赖的package包/类
public void drawScrollbar(int mouseX, int mouseY) {
  boolean hoverUp = btnUp.contains(mouseX, mouseY);
  boolean hoverDown = btnDown.contains(mouseX, mouseY);

  IWidgetIcon iconUp;
  if (pressedUp) {
    iconUp = hoverUp ? EnderWidget.UP_ARROW_HOVER_ON : EnderWidget.UP_ARROW_ON;
  } else {
    iconUp = hoverUp ? EnderWidget.UP_ARROW_HOVER_OFF : EnderWidget.UP_ARROW_OFF;
  }

  IWidgetIcon iconDown;
  if (pressedDown) {
    iconDown = hoverDown ? EnderWidget.DOWN_ARROW_HOVER_ON : EnderWidget.DOWN_ARROW_ON;
  } else {
    iconDown = hoverDown ? EnderWidget.DOWN_ARROW_HOVER_OFF : EnderWidget.DOWN_ARROW_OFF;
  }

  if (scrollDir != 0) {
    long time = Minecraft.getSystemTime();
    if ((timeNextScroll - time) <= 0) {
      timeNextScroll = time + 100;
      scrollBy(scrollDir);
    }
  }

  RenderUtil.bindTexture(EnderWidget.TEXTURE);
  GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
  GL11.glEnable(GL11.GL_BLEND);
  GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  GL11.glColor3f(1, 1, 1);

  Tessellator tes = Tessellator.instance;
  tes.startDrawingQuads();

  iconUp.getMap().render(iconUp, btnUp.x, btnUp.y, false);
  iconDown.getMap().render(iconDown, btnDown.x, btnDown.y, false);

  if (scrollMax > 0) {
    int thumbPos = getThumbPosition();
    boolean hoverThumb = thumbArea.contains(mouseX, mouseY) && mouseY >= thumbPos && mouseY < thumbPos + (int) EnderWidget.VSCROLL_THUMB_OFF.height;

    EnderWidget iconThumb;
    if (pressedThumb) {
      iconThumb = EnderWidget.VSCROLL_THUMB_HOVER_ON;
    } else {
      iconThumb = hoverThumb ? EnderWidget.VSCROLL_THUMB_HOVER_OFF : EnderWidget.VSCROLL_THUMB_OFF;
    }
    iconThumb.getMap().render(iconThumb, thumbArea.x, thumbPos, false);
  }

  tes.draw();
  GL11.glPopAttrib();
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:55,代码来源:VScrollbar.java


注:本文中的com.enderio.core.api.client.render.IWidgetIcon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。