当前位置: 首页>>代码示例>>Java>>正文


Java Gui.drawScaledCustomSizeModalRect方法代码示例

本文整理汇总了Java中net.minecraft.client.gui.Gui.drawScaledCustomSizeModalRect方法的典型用法代码示例。如果您正苦于以下问题:Java Gui.drawScaledCustomSizeModalRect方法的具体用法?Java Gui.drawScaledCustomSizeModalRect怎么用?Java Gui.drawScaledCustomSizeModalRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.gui.Gui的用法示例。


在下文中一共展示了Gui.drawScaledCustomSizeModalRect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ourDrawEntry

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public void ourDrawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isHovering)
{
    Util.getWrapper().draw(wrapped, slotIndex, x, y, listWidth, slotHeight, mouseX > (listWidth / 2) ? mouseX : Integer.MAX_VALUE, mouseY, false);

    Server server = getServerData().server;
    EnumFlag flag = server.flag;
    if (flag == null)
        return;

    Minecraft.getMinecraft().getTextureManager().bindTexture(flags);
    int flagWidth = 16;
    int flagHeight = flag.height / (flag.width / flagWidth);
    Gui.drawScaledCustomSizeModalRect(x + listWidth - 5 - flagWidth, y + slotHeight - flagHeight, flag.x, flag.y, flag.width, flag.height, flagWidth, flagHeight, 512, 512);
    if (mouseX >= x + listWidth - 5 - flagWidth
        && mouseX <= x + listWidth - 5
        && mouseY >= y + slotHeight - flagHeight
        && mouseY <= y + slotHeight - flagHeight + flagHeight)
    {
        String countryName = Callbacks.getCountries().get(flag.name());
        if (countryName == null)
        {
            countryName = flag.name();
        }
        owner.setHoveringText(countryName + (server.subdivision.equals("Unknown") ? "" : "\n" + server.subdivision));
    }
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:27,代码来源:ServerListEntryPublic.java

示例2: func_178663_a

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public void func_178663_a(float p_178663_1_, int alpha)
{
    int i = -1;
    String s = FontRenderer.getFormatFromString(this.field_178676_b.getColorPrefix());

    if (s.length() >= 2)
    {
        i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
    }

    if (i >= 0)
    {
        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        Gui.drawRect(1, 1, 15, 15, MathHelper.func_180183_b(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
    }

    Minecraft.getMinecraft().getTextureManager().bindTexture(this.field_178677_c);
    GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:TeleportToTeam.java

示例3: renderIcon

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public void renderIcon(float p_178663_1_, int alpha)
{
    int i = -1;
    String s = FontRenderer.getFormatFromString(this.team.getColorPrefix());

    if (s.length() >= 2)
    {
        i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
    }

    if (i >= 0)
    {
        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        Gui.drawRect(1, 1, 15, 15, MathHelper.rgb(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
    }

    Minecraft.getMinecraft().getTextureManager().bindTexture(this.location);
    GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:TeleportToTeam.java

示例4: func_178663_a

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public void func_178663_a(float p_178663_1_, int alpha)
{
    Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
    GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:PlayerMenuObject.java

示例5: renderIcon

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public void renderIcon(float p_178663_1_, int alpha)
{
    Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
    GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
    Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:PlayerMenuObject.java

示例6: draw

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
@Override
public void draw(int x, int y, int mouseX, int mouseY, GuiScreen notebook)
{
	// Make an embedded matrix for rendering crafting recipes
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();

	// dodgy way of making the texture render properly. Not sure what GL thing I need to change for it to work without this/
	notebook.mc.fontRenderer.drawString("", x, y, 0x000000);

	// Adjust the x and y to make rendering easier
	x += 22;
	y += 3;

	// Bind the actual notebook texture
	notebook.mc.getTextureManager().bindTexture(GuiNotebook.notebook);

	// Draw the crafting grid
	Gui.drawScaledCustomSizeModalRect(x + 20, y - 3, 18, 18, 1, 1, 2, 73, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x - 3, y + 20, 18, 18, 1, 1, 73, 2, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x + 45, y - 3, 18, 18, 1, 1, 2, 73, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x - 3, y + 45, 18, 18, 1, 1, 73, 2, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);

	// Draw the crafting output box
	Gui.drawScaledCustomSizeModalRect(x + 108, y + 20, 18, 18, 1, 1, 26, 2, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x + 108, y + 44, 18, 18, 1, 1, 26, 2, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x + 108, y + 20, 18, 18, 1, 1, 2, 25, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);
	Gui.drawScaledCustomSizeModalRect(x + 132, y + 20, 18, 18, 1, 1, 2, 25, GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);

	// This involves rendering items, so we need to ensure they don't turn black
	RenderHelper.enableGUIStandardItemLighting();

	// Render the crafting recipe
	for (int inputX = 0; inputX < 3; inputX++)
	{
		for (int inputY = 0; inputY < 3; inputY++)
		{
			if (recipeIn[inputY][inputX] != ItemStack.EMPTY)
			{
				// Render the recipe component
				notebook.mc.getRenderItem().renderItemAndEffectIntoGUI(recipeIn[inputY][inputX], x + (inputX * 25),
						y + (inputY * 25));

			}
		}
	}

	// Draw the arrow to show the output of the recipe
	notebook.mc.getTextureManager().bindTexture(GuiNotebook.notebook);
	Gui.drawScaledCustomSizeModalRect(x + 78, y + 26, 158, 182, 22, 15, (22), (15), GuiNotebook.NOTEBOOK_WIDTH,
			GuiNotebook.NOTEBOOK_TEX_HEIGHT);

	// Draw the output item in the recipe
	notebook.mc.getRenderItem().renderItemAndEffectIntoGUI(recipeOut, x + 113, y + 25);

	// So that it works when we render normal stuff after
	RenderHelper.disableStandardItemLighting();

	// Go back to the main render matrix
	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:71,代码来源:NotebookEntryCraftingRecipe.java

示例7: blit

import net.minecraft.client.gui.Gui; //导入方法依赖的package包/类
public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_, int p_blit_7_, float p_blit_8_, float p_blit_9_)
{
    Gui.drawScaledCustomSizeModalRect(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_, p_blit_8_, p_blit_9_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:RealmsScreen.java


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