当前位置: 首页>>代码示例>>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;未经允许,请勿转载。