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


Java IIcon.getInterpolatedU方法代碼示例

本文整理匯總了Java中net.minecraft.util.IIcon.getInterpolatedU方法的典型用法代碼示例。如果您正苦於以下問題:Java IIcon.getInterpolatedU方法的具體用法?Java IIcon.getInterpolatedU怎麽用?Java IIcon.getInterpolatedU使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.IIcon的用法示例。


在下文中一共展示了IIcon.getInterpolatedU方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getU

import net.minecraft.util.IIcon; //導入方法依賴的package包/類
public float getU(final int i, final IIcon texture, final int rotation, final float[] u, final float[] v) {
    switch (rotation % 4) {
        case 0: {
            return texture.getInterpolatedU((double)(u[i % 4] * 16.0f));
        }
        case 1: {
            return texture.getInterpolatedU((double)(v[i % 4] * 16.0f));
        }
        case 2: {
            return texture.getInterpolatedU((double)(16.0f - u[i % 4] * 16.0f));
        }
        case 3: {
            return texture.getInterpolatedU((double)(16.0f - v[i % 4] * 16.0f));
        }
        default: {
            return 0.0f;
        }
    }
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:20,代碼來源:RenderBlockSpike.java

示例2: draw

import net.minecraft.util.IIcon; //導入方法依賴的package包/類
@Override
public void draw(Renderer renderer, int x, int y)
{
	if(liquid != null)
	{
		TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

		Fluid fluid = liquid.getFluid();
		IIcon icon = fluid.getStillIcon();

		if(icon != null)
		{
			textureManager.bindTexture(TextureMap.locationBlocksTexture);

               double u = icon.getInterpolatedU(3.0);
               double u2 = icon.getInterpolatedU(13.0);
               double v = icon.getInterpolatedV(1.0);
               double v2 = icon.getInterpolatedV(15.0);

               GL11.glEnable(GL11.GL_TEXTURE_2D);
               GL11.glColor4d(1.0, 1.0, 1.0, 1.0);

       		GL11.glBegin(GL11.GL_QUADS);
       	        GL11.glTexCoord2d(u, v);
       	        GL11.glVertex2i(x + 3, y + 1);

       	        GL11.glTexCoord2d(u, v2);
       	        GL11.glVertex2i(x + 3, y + 15);

       	        GL11.glTexCoord2d(u2, v2);
       	        GL11.glVertex2i(x + 13, y + 15);

       	        GL11.glTexCoord2d(u2, v);
       	        GL11.glVertex2i(x + 13, y + 1);
       		GL11.glEnd();
		}
	}

	renderer.renderRect(x - 1, y - 1, 18, 18, containerTexture);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:41,代碼來源:LiquidFilter.java

示例3: renderTorchAtAngle

import net.minecraft.util.IIcon; //導入方法依賴的package包/類
public static void renderTorchAtAngle(RenderBlocks renderBlocks, Block par1Block, double par2, double par4, double par6, double par8, double par10)
{
    // if (par1Block instanceof GCCoreBlockUnlitTorch)
    {
        final Tessellator tessellator = Tessellator.instance;
        IIcon icon = renderBlocks.getBlockIconFromSideAndMetadata(par1Block, 0, 0);

        final double d5 = icon.getMinU();
        final double d6 = icon.getMinV();
        final double d7 = icon.getMaxU();
        final double d8 = icon.getMaxV();
        final double d9 = icon.getInterpolatedU(7.0D);
        final double d10 = icon.getInterpolatedV(6.0D);
        final double d11 = icon.getInterpolatedU(9.0D);
        final double d12 = icon.getInterpolatedV(8.0D);
        final double d13 = icon.getInterpolatedU(7.0D);
        final double d14 = icon.getInterpolatedV(13.0D);
        final double d15 = icon.getInterpolatedU(9.0D);
        final double d16 = icon.getInterpolatedV(15.0D);
        par2 += 0.5D;
        par6 += 0.5D;
        final double d17 = par2 - 0.5D;
        final double d18 = par2 + 0.5D;
        final double d19 = par6 - 0.5D;
        final double d20 = par6 + 0.5D;
        final double d21 = 0.0625D;
        final double d22 = 0.625D;
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) - d21, par4 + d22, par6 + par10 * (1.0D - d22) - d21, d9, d10);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) - d21, par4 + d22, par6 + par10 * (1.0D - d22) + d21, d9, d12);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) + d21, par4 + d22, par6 + par10 * (1.0D - d22) + d21, d11, d12);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) + d21, par4 + d22, par6 + par10 * (1.0D - d22) - d21, d11, d10);
        tessellator.addVertexWithUV(par2 + d21 + par8, par4, par6 - d21 + par10, d15, d14);
        tessellator.addVertexWithUV(par2 + d21 + par8, par4, par6 + d21 + par10, d15, d16);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4, par6 + d21 + par10, d13, d16);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4, par6 - d21 + par10, d13, d14);
        tessellator.addVertexWithUV(par2 - d21, par4 + 1.0D, d19, d5, d6);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4 + 0.0D, d19 + par10, d5, d8);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4 + 0.0D, d20 + par10, d7, d8);
        tessellator.addVertexWithUV(par2 - d21, par4 + 1.0D, d20, d7, d6);
        tessellator.addVertexWithUV(par2 + d21, par4 + 1.0D, d20, d5, d6);
        tessellator.addVertexWithUV(par2 + par8 + d21, par4 + 0.0D, d20 + par10, d5, d8);
        tessellator.addVertexWithUV(par2 + par8 + d21, par4 + 0.0D, d19 + par10, d7, d8);
        tessellator.addVertexWithUV(par2 + d21, par4 + 1.0D, d19, d7, d6);
        tessellator.addVertexWithUV(d17, par4 + 1.0D, par6 + d21, d5, d6);
        tessellator.addVertexWithUV(d17 + par8, par4 + 0.0D, par6 + d21 + par10, d5, d8);
        tessellator.addVertexWithUV(d18 + par8, par4 + 0.0D, par6 + d21 + par10, d7, d8);
        tessellator.addVertexWithUV(d18, par4 + 1.0D, par6 + d21, d7, d6);
        tessellator.addVertexWithUV(d18, par4 + 1.0D, par6 - d21, d5, d6);
        tessellator.addVertexWithUV(d18 + par8, par4 + 0.0D, par6 - d21 + par10, d5, d8);
        tessellator.addVertexWithUV(d17 + par8, par4 + 0.0D, par6 - d21 + par10, d7, d8);
        tessellator.addVertexWithUV(d17, par4 + 1.0D, par6 - d21, d7, d6);
    }

}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:55,代碼來源:BlockRendererUnlitTorch.java

示例4: apply

import net.minecraft.util.IIcon; //導入方法依賴的package包/類
@Override
public void apply(UV uv) {
    IIcon icon = icons[uv.tex % icons.length];
    uv.u = icon.getInterpolatedU(uv.u * 16);
    uv.v = icon.getInterpolatedV(uv.v * 16);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:7,代碼來源:MultiIconTransformation.java

示例5: draw

import net.minecraft.util.IIcon; //導入方法依賴的package包/類
@Override
public void draw(Renderer renderer, int recipeX, int recipeY, Object[] data, int dataIndex, boolean isMouseOver)
{
	int x = recipeX + this.x;
	int y = recipeY + this.y;

	if(data[dataIndex] instanceof FluidStack)
	{
		FluidStack liquid = (FluidStack)data[dataIndex];

		TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

		Fluid fluid = liquid.getFluid();
		IIcon icon = fluid.getStillIcon();

		if(icon != null)
		{
			textureManager.bindTexture(TextureMap.locationBlocksTexture);

               double u = icon.getInterpolatedU(3.0);
               double u2 = icon.getInterpolatedU(13.0);
               double v = icon.getInterpolatedV(1.0);
               double v2 = icon.getInterpolatedV(15.0);

               GL11.glEnable(GL11.GL_TEXTURE_2D);
               GL11.glColor4d(1.0, 1.0, 1.0, 1.0);

       		GL11.glBegin(GL11.GL_QUADS);
       	        GL11.glTexCoord2d(u, v);
       	        GL11.glVertex2i(x + 3, y + 1);

       	        GL11.glTexCoord2d(u, v2);
       	        GL11.glVertex2i(x + 3, y + 15);

       	        GL11.glTexCoord2d(u2, v2);
       	        GL11.glVertex2i(x + 13, y + 15);

       	        GL11.glTexCoord2d(u2, v);
       	        GL11.glVertex2i(x + 13, y + 1);
       		GL11.glEnd();
		}
	}

	renderer.renderRect(x - 1, y - 1, 18, 18, containerTexture);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:46,代碼來源:LiquidSlot.java


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