本文整理汇总了Java中net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent类的典型用法代码示例。如果您正苦于以下问题:Java BackgroundDrawnEvent类的具体用法?Java BackgroundDrawnEvent怎么用?Java BackgroundDrawnEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BackgroundDrawnEvent类属于net.minecraftforge.client.event.GuiScreenEvent包,在下文中一共展示了BackgroundDrawnEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDrawBackgroundEventPost
import net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent; //导入依赖的package包/类
@SubscribeEvent (priority = EventPriority.LOWEST)//We need to be called after JEI as this is is a render overlay.
public void onDrawBackgroundEventPost(BackgroundDrawnEvent event) {
GuiTextFieldFilter fieldFilter = JEIIntegrationManager.getTextFieldFilter();
if (!ClientUtils.inWorld() || !isNEIInWorld() || fieldFilter == null || !SearchField.searchInventories() || JEIIntegrationManager.searchBoxOwner != EnumItemBrowser.JEI || JEIIntegrationManager.itemPanelOwner == EnumItemBrowser.NEI) {
return;
}
int x = fieldFilter.x;
int y = fieldFilter.y;
int h = fieldFilter.height;
int w = fieldFilter.width;
GuiDraw.drawGradientRect(x - 1, y - 1, 1, h + 2, 0xFFFFFF00, 0xFFC0B000);//Left
GuiDraw.drawGradientRect(x - 1, y - 1, w + 2, 1, 0xFFFFFF00, 0xFFC0B000);//Top
GuiDraw.drawGradientRect(x + w, y - 1, 1, h + 2, 0xFFFFFF00, 0xFFC0B000);//Left
GuiDraw.drawGradientRect(x - 1, y + h, w + 2, 1, 0xFFFFFF00, 0xFFC0B000);//Bottom
}
示例2: onBackgroundDrawEvent
import net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onBackgroundDrawEvent(BackgroundDrawnEvent event)
{
if (!this.shouldDisplayGuiOverlay(event.getGui())) { return; }
this.getGuiOverlay().drawBackground();
this.getGuiOverlay().drawScreen(event.getMouseX(), event.getMouseY());
}
示例3: drawProgressIndicatorsInInventory
import net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent; //导入依赖的package包/类
@SubscribeEvent
public void drawProgressIndicatorsInInventory(BackgroundDrawnEvent event) {
if (ConfigurationHandler.showQuestsInPlayerInventory && mc.currentScreen instanceof GuiInventory) {
buildQuestInventoryGui(event);
} else if (mc.currentScreen instanceof DailiesGuiContainer) {
buildAvailableQuestGui(event.getMouseX(), event.getMouseY());
buildQuestInventoryGui(event);
}
}
示例4: buildQuestInventoryGui
import net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent; //导入依赖的package包/类
public void buildQuestInventoryGui(BackgroundDrawnEvent event) {
if (!isSet(DailiesPacketHandler.acceptedQuests)) {
DailiesPacketHandler.INSTANCE.sendToServer(new RequestAcceptedQuests());
return;
}
ScaledResolution viewport = new ScaledResolution(mc);
int xPos = viewport.getScaledWidth() - 122 - 22;
int yPos = (viewport.getScaledHeight() / 2) - (inventoryHeight / 2);
adjustGlStateManager();
acceptedBadgeList.clear();
abandonButtonMap.clear();
for (int i = 0; i < questsPerPage; i++) {
if (DailiesPacketHandler.acceptedQuests.size() < i + offsetAccepted + 1) {
break;
}
DailyQuest quest = (DailyQuest) DailiesPacketHandler.acceptedQuests.toArray()[i + offsetAccepted];
acceptedBadgeList.add(new GuiDailyBadge(quest, mc, xPos, yPos));
abandonButtonMap.put(quest.id, new GuiButton(i + 10, xPos + 122, yPos+4, 20, 20, "X"));
yPos += 30;
}
offsetAccepted = drawPagerButtons(viewport, xPos, event.getMouseX(), event.getMouseY(), offsetAccepted, DailiesPacketHandler.acceptedQuests.size());
drawQuestAbandonButtons(event.getMouseX(), event.getMouseY());
}