本文整理汇总了Java中com.enderio.core.client.gui.widget.GhostSlot.isMouseOver方法的典型用法代码示例。如果您正苦于以下问题:Java GhostSlot.isMouseOver方法的具体用法?Java GhostSlot.isMouseOver怎么用?Java GhostSlot.isMouseOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.enderio.core.client.gui.widget.GhostSlot
的用法示例。
在下文中一共展示了GhostSlot.isMouseOver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGhostSlot
import com.enderio.core.client.gui.widget.GhostSlot; //导入方法依赖的package包/类
protected GhostSlot getGhostSlot(GuiContainerBase guiContainerBase, int mouseX, int mouseY) {
mouseX -= guiContainerBase.getGuiLeft();
mouseY -= guiContainerBase.getGuiTop();
for (GhostSlot slot : ghostSlots) {
if (slot.isVisible() && slot.isMouseOver(mouseX, mouseY)) {
return slot;
}
}
return null;
}
示例2: drawGhostSlots
import com.enderio.core.client.gui.widget.GhostSlot; //导入方法依赖的package包/类
protected void drawGhostSlots(GuiContainerBase gui, int mouseX, int mouseY) {
int sx = gui.getGuiLeft();
int sy = gui.getGuiTop();
gui.drawFakeItemsStart();
try {
gui.hoverGhostSlot = hoverGhostSlot = null;
for (GhostSlot slot : ghostSlots) {
ItemStack stack = slot.getStack();
if (slot.isVisible()) {
if (stack != null) {
gui.drawFakeItemStack(slot.x + sx, slot.y + sy, stack);
if (slot.shouldDisplayStdOverlay()) {
gui.drawFakeItemStackStdOverlay(slot.x + sx, slot.y + sy, stack);
}
if (slot.shouldGrayOut()) {
gui.ghostSlotHandler.drawGhostSlotGrayout(gui, slot);
}
}
if (slot.isMouseOver(mouseX - sx, mouseY - sy)) {
gui.hoverGhostSlot = hoverGhostSlot = slot;
}
}
}
if (hoverGhostSlot != null) {
// draw hover last to prevent it from affecting rendering of other slots ...
gui.drawFakeItemHover(hoverGhostSlot.x + sx, hoverGhostSlot.y + sy);
}
} finally {
gui.drawFakeItemsEnd();
}
}