當前位置: 首頁>>代碼示例>>Java>>正文


Java BackgroundDrawnEvent類代碼示例

本文整理匯總了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

}
 
開發者ID:TheCBProject,項目名稱:NotEnoughItems,代碼行數:19,代碼來源:ContainerEventHandler.java

示例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());
}
 
開發者ID:sidben,項目名稱:VisibleArmorSlots,代碼行數:10,代碼來源:EventDelegatorGuiOverlay.java

示例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);
	}
}
 
開發者ID:ToroCraft,項目名稱:Dailies,代碼行數:10,代碼來源:GuiDailyProgressIndicators.java

示例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());
}
 
開發者ID:ToroCraft,項目名稱:Dailies,代碼行數:29,代碼來源:GuiDailyProgressIndicators.java


注:本文中的net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。