• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GuiUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: drawTwitch

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
private static void drawTwitch()
{
    if(tsize == 3){
        textU = 0;
        textV = 0;
    }else if(tsize == 2){
        textU = 0;
        textV = 38;
    }else if(tsize == 1){
        textU = -1;
        textV = 87;
    }else{
        textU = 0;
        textV = 0;
    }
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:21,代码来源:TCDrawScreen.java


示例2: drawLive

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
private static void drawLive()
{
    if(tsize == 3){
        textLU = 24;
        textLV = 0;
    }else if(tsize == 2){
        textLU = 25;
        textLV = 38;
    }else if(tsize == 1){
        textLU = 26;
        textLV = 87;
    }else{
        textU = 0;
        textV = 0;
    }
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:21,代码来源:TCDrawScreen.java


示例3: drawTooltip

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
private static void drawTooltip(GuiScreen gui, int mouseX, int mouseY)
{
    List<String> tooltip = new ArrayList<String>();
    if(Twitchy.isLive) {
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("Stream Title:" + " " + "\u00A79" + Twitchy.streamTitle);
            tooltip.add("Current Game:" + " " + "\u00A72" + Twitchy.streamGame);
            tooltip.add("Current Viewers:" + " " + "\u00A74" + Twitchy.streamViewers);
        }else
            tooltip.add("Click to watch " + "\u00A76" + CHANNEL + " " + "\u00A7flive on Twitch!");
        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }else
        tooltip.add("\u00A76" + CHANNEL +"'s" + "\u00A7f offline. Click to go to their channel.");

    GuiUtils.drawHoveringText(tooltip, mouseX, mouseY + 20, gui.width, gui.height, -1, mc.fontRenderer);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:18,代码来源:TCDrawScreen.java


示例4: drawItemStackTooltip

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public void drawItemStackTooltip(final IGuiRenderer renderer, final int mouseX, final int mouseY,
        final ItemStack stack)
{
    final List<String> list = stack.getTooltip(this.mc.player,  this.mc.gameSettings.advancedItemTooltips ?
            ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL);

    for (int i = 0; i < list.size(); ++i)
    {
        if (i == 0)
            list.set(i, stack.getRarity().rarityColor + list.get(i));
        else
            list.set(i, TextFormatting.GRAY + list.get(i));
    }
    GuiUtils.drawHoveringText(stack, list, mouseX, mouseY, this.mc.displayWidth, this.mc.displayHeight,
            this.mc.displayWidth, this.mc.fontRenderer);
}
 
开发者ID:Yggard,项目名称:BrokkGUI,代码行数:17,代码来源:GuiHelper.java


示例5: drawButton

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
/**
 * Draws this button to the screen.
 */
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial){
    if (this.visible) {
        this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
        int k = this.getHoverState(this.hovered);
        GuiUtils.drawContinuousTexturedBox(FalloutWidgets, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
        this.mouseDragged(mc, mouseX, mouseY);
        int color = 15435844;
        if (packedFGColour != 0) {
            color = packedFGColour;
        } else if (!this.enabled) {
            color = 5320730;
        } else if (this.hovered) {
            color = 15465844;
        }
        String buttonText = this.displayString;
        int strWidth = mc.fontRenderer.getStringWidth(buttonText);
        int ellipsisWidth = mc.fontRenderer.getStringWidth("...");
        if (strWidth > width - 6 && strWidth > ellipsisWidth)
            buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
        this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
    }
}
 
开发者ID:Hoijima,项目名称:Fallout_Equestria,代码行数:27,代码来源:GuiButtonExtFallout_pipbuck.java


示例6: drawButton

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
/**
 * Draws this button to the screen.
 */
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial){

    if (this.visible) {
        this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
        int k = this.getHoverState(this.hovered);
        GuiUtils.drawContinuousTexturedBox(FalloutWidgets, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
        this.mouseDragged(mc, mouseX, mouseY);
        int color = Color_and_Etc.rawColorFromRGB(ConfigInit.colorR, ConfigInit.colorG, ConfigInit.colorB);
        if (packedFGColour != 0) {
            color = packedFGColour;
        } else if (!this.enabled) {
        } else if (this.hovered) {
        }
        String buttonText = this.displayString;
        int strWidth = mc.fontRenderer.getStringWidth(buttonText);
        int ellipsisWidth = mc.fontRenderer.getStringWidth("...");
        if (strWidth > width - 6 && strWidth > ellipsisWidth)
            buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
        this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
    }

}
 
开发者ID:Hoijima,项目名称:Fallout_Equestria,代码行数:27,代码来源:GuiButtonExtFallout.java


示例7: renderToolTip

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
protected void renderToolTip(ItemStack stack, int x, int y) {
    List<String> list = stack.getTooltip(ClientProxy.mc.player, ClientProxy.getToolTipFlags());

    for (int i = 0; i < list.size(); ++i) {
        if (i == 0) {
            list.set(i, stack.getRarity().rarityColor + list.get(i));
        } else {
            list.set(i, TextFormatting.GRAY + list.get(i));
        }
    }

    ScaledResolution res = new ScaledResolution(ClientProxy.mc);
    FontRenderer font = stack.getItem().getFontRenderer(stack);
    net.minecraftforge.fml.client.config.GuiUtils.preItemToolTip(stack);
    GuiUtils.drawHoveringText(list, x, y, res.getScaledWidth(), res.getScaledHeight(), res.getScaledWidth(), (font == null ? ClientProxy.mc.fontRenderer : font));
    net.minecraftforge.fml.client.config.GuiUtils.postItemToolTip();
}
 
开发者ID:univrsal,项目名称:IIDY,代码行数:18,代码来源:GuiButtonItem.java


示例8: drawButton

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
/** Draws this button to the screen. */
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
	if (this.visible) {
		this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.boxWidth
				&& mouseY < this.yPosition + this.height;
		GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.xPosition, this.yPosition, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2,
				2, this.zLevel);
		this.mouseDragged(mc, mouseX, mouseY);
		int color = 14737632;

		if (packedFGColour != 0) {
			color = packedFGColour;
		} else if (!this.enabled) {
			color = 10526880;
		}

		if (this.isChecked())
			this.drawCenteredString(mc.fontRendererObj, checkStr, this.xPosition + this.boxWidth / 2 + 1, this.yPosition + 1, 14737632);
	}
}
 
开发者ID:zerofall,项目名称:EZStorage2,代码行数:22,代码来源:GuiCheckBoxCustom.java


示例9: draw

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
@Override
public void draw(int x, int y, int mouseX, int mouseY, float partialTicks) {
	GlStateManager.color(1, 1, 1, 1);
	hovered = mouseX >= x && mouseY >= y && mouseX < x + 32 && mouseY < y + 16;
	GlStateManager.enableBlend();
	GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GuiUtils.drawContinuousTexturedBox(buttonLocation, x, y, 0, hovered ? 86 : 66, 32, 16, 200, 20, 3,
			partialTicks);
	GlStateManager.disableDepth();
	Minecraft.getMinecraft().getTextureManager().bindTexture(arrowLocation);
	Gui.drawModalRectWithCustomSizedTexture(x + 8, y, isExpanded ? 16 : 0, hovered ? 16 : 0, 16, 16, 32, 32);
	GlStateManager.enableDepth();

	if (isExpanded)
		child.draw(x, y + 18, mouseX, mouseY, partialTicks);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:18,代码来源:CommandSlotExpand.java


示例10: CommandSlotList

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
/**
 * Constructs a list
 * 
 * @param instantiator
 *            - how to create a new entry, when the user presses a + button
 * @param children
 *            - pre-existing entries
 */
public CommandSlotList(Supplier<E> instantiator, E... children) {
	super();
	this.supplier = instantiator;
	for (E child : children) {
		addEntry(child);
	}
	addChild(appendButton = new CommandSlotButton(20, 20, "+", Translate.GUI_COMMANDEDITOR_LIST_APPEND) {
		{
			setTextColor(GuiUtils.getColorCode('2', true));
		}

		@Override
		public void onPress() {
			addEntry(CommandSlotList.this.supplier.get());
		}
	});
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:26,代码来源:CommandSlotList.java


示例11: Entry

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public Entry(int ind) {
	this.ind = ind;
	addChild(insertButton = new CommandSlotButton(20, 20, "+", insertHoverText) {
		{
			setTextColor(GuiUtils.getColorCode('2', true));
		}

		@Override
		public void onPress() {
			addEntry(Entry.this.ind, supplier.get());
		}
	});
	addChild(removeButton = new CommandSlotButton(20, 20, "x", removeHoverText) {
		{
			setTextColor(GuiUtils.getColorCode('c', true));
		}

		@Override
		public void onPress() {
			removeEntry(Entry.this.ind);
		}

	});
	addChild(entries.get(ind));
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:26,代码来源:CommandSlotList.java


示例12: drawGuiContainerBackgroundLayer

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
	/*
	 * Draw Panel + Player Inventory Slots
	 */
	Minecraft.getMinecraft().getTextureManager().bindTexture(guiTexture);

	int offset = Config.dark_theme ? 0 : 44;

	GuiUtils.drawContinuousTexturedBox(guiLeft, guiTop, offset, 0, ContainerAdvancedMachine.panelWidth, ContainerAdvancedMachine.panelHeight, 44, 44, 20, 0);

	offset = Config.dark_theme ? 134 : 44;

	drawTexturedModalRect(guiLeft + ContainerAdvancedMachine.panelWidth / 2 - 176 / 2, guiTop + ContainerAdvancedMachine.panelHeight - 3, 0, offset, 176, 90);

	/*
	 * Draw app background
	 */
	if (machineContainer.activeApp != null) {
		machineContainer.activeApp.gui.drawBackground(this, partialTicks, mouseX, mouseY);
	}
}
 
开发者ID:Team-IO,项目名称:taam,代码行数:23,代码来源:GuiAdvancedMachine.java


示例13: drawButton

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial) {
    if (this.visible) {
        this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
        int k = this.getHoverState(this.hovered);
        GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
        this.mouseDragged(mc, mouseX, mouseY);

        GlStateManager.pushMatrix();
        if (this.icon.isEmpty()) {
            this.icon = new ItemStack(Blocks.STONE);
        }
        ItemRenderHelper.renderItem(this.x + this.width / 2, this.y + this.height / 2, icon);
        GlStateManager.popMatrix();
    }
}
 
开发者ID:dmillerw,项目名称:MineMenu,代码行数:17,代码来源:GuiItemButton.java


示例14: BaseEntry

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public BaseEntry() {
	super(Direction.HORIZONTAL);
	setFillHorizontal();
	
	iconStatus = new GuiImage(16, 16, TEXTURE_CONFIG_ICONS);
	iconStatus.setCenteredVertical();
	
	label = new GuiLabel("");
	label.setCenteredVertical();
	label.setShadowDisabled();
	
	buttonUndo = new GuiButtonGlyph(DEFAULT_ENTRY_HEIGHT, DEFAULT_ENTRY_HEIGHT, GuiUtils.UNDO_CHAR, 1.0f);
	buttonUndo.setCenteredVertical();
	buttonUndo.setAction(this::undoChanges);
	
	buttonReset = new GuiButtonGlyph(DEFAULT_ENTRY_HEIGHT, DEFAULT_ENTRY_HEIGHT, GuiUtils.RESET_CHAR, 1.0f);
	buttonReset.setCenteredVertical();
	buttonReset.setAction(this::setToDefault);
}
 
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:20,代码来源:BaseEntry.java


示例15: drawIcon

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
private static void drawIcon()
{
    if(!Twitchy.persistantIcon && !Twitchy.isLive) return;
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
    if(Twitchy.isLive)
        GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:11,代码来源:TCDrawScreen.java


示例16: drawOverlay

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public void drawOverlay(int mouseX, int mouseY) {
    if (this.isMouseOver(mouseX, mouseY)) {
        Minecraft mc = Minecraft.getMinecraft();

        List<String> text = new ArrayList<String>();
        text.add(this.getOverlayText());
        GuiUtils.drawHoveringText(text, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer);
    }
}
 
开发者ID:CreeperShift,项目名称:WirelessCharger,代码行数:10,代码来源:EnergyDisplay.java


示例17: drawGui

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public void drawGui(float partialTicks)
{
	Minecraft mc = Minecraft.getMinecraft();
	ScaledResolution res = new ScaledResolution(mc);

	Minecraft.getMinecraft().renderEngine.bindTexture(elements);

	ItemStack shieldStack = EntityUtil.getActivePlayerShield(mc.player);
	ItemAnimaShield shieldItem = (ItemAnimaShield) shieldStack.getItem();

	float currentCharge = shieldItem.getShieldCharge(shieldStack);
	float maxCharge = shieldItem.getMaxShieldCharge(shieldStack);

	if(startingCharge == -1)
		startingCharge = currentCharge;

	if(currentCharge == maxCharge || startingCharge == currentCharge)
	{
		moveSecondary = true;
	}
	boolean drawFill = currentCharge > 0;

	int asPercent = drawFill ? (int) ((currentCharge * 100)/ maxCharge) : 999;
	float fillWidth = maxBarWidth - (int) (maxBarWidth * ((float)asPercent/100));

	boolean drawSecondary = secondaryWidth != fillWidth && moveSecondary;

	int drawWidth = maxBarWidth - (int)fillWidth;

	GuiUtils.drawTexturedModalRect(getStartX(res), getStartY(res), 0, 16, 92, 10, 400);
	if(drawSecondary)
		GuiUtils.drawTexturedModalRect(getStartX(res) + 1, getStartY(res) + 1, 0, 8 , secondaryWidth, 8, 400);
	if(drawFill)
		GuiUtils.drawTexturedModalRect(getStartX(res) + 1, getStartY(res) + 1, 0, 0 ,  drawWidth,8, 400);

}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:37,代码来源:GuiShield.java


示例18: drawBackground

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public static void drawBackground(float lines, float maxWidth, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font)
{
	if (lines > 0)
	{
		GlStateManager.disableRescaleNormal();
		RenderHelper.disableStandardItemLighting();
		GlStateManager.disableLighting();
		GlStateManager.disableDepth();
		float tooltipTextWidth = maxWidth;

		float tooltipX = mouseX + 12;
		float tooltipY = mouseY - 12;
		float tooltipHeight = lines;

		if (tooltipY + tooltipHeight + 6 > screenHeight)
		{
			tooltipY = screenHeight - tooltipHeight - 6;
		}

		final int zLevel = 300;
		final int backgroundColor = 0xF0100010;

		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 4, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3, backgroundColor, backgroundColor);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY + (int)tooltipHeight + 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 4, backgroundColor, backgroundColor);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 4, (int)tooltipY - 3, (int)tooltipX - 3, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 4, (int)tooltipY + (int)tooltipHeight + 3, backgroundColor, backgroundColor);
		final int borderColorStart = 0x505000FF;
		final int borderColorEnd = (borderColorStart & 0xFEFEFE) >> 1 | borderColorStart & 0xFF000000;
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3 + 1, (int)tooltipX - 3 + 1, (int)tooltipY + (int)tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX + (int)tooltipTextWidth + 2,(int) tooltipY - 3 + 1,(int) tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY - 3, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY - 3 + 1, borderColorStart, borderColorStart);
		GuiUtils.drawGradientRect(zLevel, (int)tooltipX - 3, (int)tooltipY +(int)tooltipHeight + 2, (int)tooltipX + (int)tooltipTextWidth + 3, (int)tooltipY + (int)tooltipHeight + 3, borderColorEnd, borderColorEnd);

		GlStateManager.enableDepth();
		GlStateManager.enableRescaleNormal();
	}
}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:39,代码来源:GuiAnalyser.java


示例19: draw

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
public void draw(ProgressBarSource progressSource)
{
    float progress = progressSource.getProgress(this.source);

    int w = direction.getWidth(width, progress);
    int h = direction.getHeight(height, progress);

    int offsetX = direction.getOffsetX(width, w);
    int offsetY = direction.getOffsetY(height, h);

    GuiUtils.drawTexturedModalRect(x + offsetX, y + offsetY, texX + offsetX, texY + offsetY, w, h, 0f);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:13,代码来源:ProgressBar.java


示例20: drawButton

import net.minecraftforge.fml.client.config.GuiUtils; //导入依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
	this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
	int state = this.getHoverState(this.hovered);
	GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.x, this.y, 0, 46 + state * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);

	int amt = 1;

	if (mode == 1)
		amt = 64;
	else
		amt = 1;

	ItemStack stack = new ItemStack(Blocks.STONE, amt, 0);

	GlStateManager.pushMatrix();
	GlStateManager.translate(this.x, this.y, 0.0);
	GlStateManager.scale(0.9F, 0.9F, 0.9F);
	GlStateManager.translate(-this.x, -this.y, 0.0);

	RenderHelper.disableStandardItemLighting();
	RenderHelper.enableGUIStandardItemLighting();
	mc.getRenderItem().renderItemAndEffectIntoGUI(stack, this.x + 3, this.y + 3);
	RenderHelper.enableStandardItemLighting();
	GlStateManager.popMatrix();

	mc.getRenderItem().renderItemOverlays(mc.fontRenderer, stack, this.x + 2, this.y + 2);
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:29,代码来源:GuiButtonTransferMode.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SearchPhaseExecutionException类代码示例发布时间:2022-05-21
下一篇:
Java SingletonTask类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap