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


Java Tessellator.setColorRGBA_I方法代码示例

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


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

示例1: overlayBackground

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_)
{
    Tessellator var5 = Tessellator.instance;
    this.client.renderEngine.bindTexture(Gui.optionsBackground);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float var6 = 32.0F;
    var5.startDrawingQuads();
    var5.setColorRGBA_I(4210752, p_22239_4_);
    var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
    var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
    var5.setColorRGBA_I(4210752, p_22239_3_);
    var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
    var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
    var5.draw();
}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:16,代码来源:GuiScrollingList.java

示例2: drawScreen

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void drawScreen()
{
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_FOG);
    Tessellator tessellator = Tessellator.instance;


    this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f1 = 32.0F;
    tessellator.startDrawingQuads();
    tessellator.setColorOpaque_I(2105376);
    tessellator.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, (double) ((float) this.left / f1), (double) ((float) this.bottom / f1));
    tessellator.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, (double) ((float) this.right / f1), (double) ((float) this.bottom / f1));
    tessellator.addVertexWithUV((double) this.right, (double) this.top, 0.0D, (double) ((float) this.right / f1), (double) ((float) this.top / f1));
    tessellator.addVertexWithUV((double) this.left, (double) this.top, 0.0D, (double) ((float) this.left / f1), (double) ((float) this.top / f1));
    tessellator.draw();


    GL11.glDisable(GL11.GL_DEPTH_TEST);
    byte b0 = 4;
    GL11.glEnable(GL11.GL_BLEND);
    OpenGlHelper.glBlendFunc(770, 771, 0, 1);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glShadeModel(GL11.GL_SMOOTH);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_I(0, 0);
    tessellator.addVertexWithUV((double) this.left, (double) (this.top + b0), 0.0D, 0.0D, 1.0D);
    tessellator.addVertexWithUV((double) this.right, (double) (this.top + b0), 0.0D, 1.0D, 1.0D);
    tessellator.setColorRGBA_I(0, 255);
    tessellator.addVertexWithUV((double) this.right, (double) this.top, 0.0D, 1.0D, 0.0D);
    tessellator.addVertexWithUV((double) this.left, (double) this.top, 0.0D, 0.0D, 0.0D);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_I(0, 255);
    tessellator.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, 0.0D, 1.0D);
    tessellator.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, 1.0D, 1.0D);
    tessellator.setColorRGBA_I(0, 0);
    tessellator.addVertexWithUV((double) this.right, (double) (this.bottom - b0), 0.0D, 1.0D, 0.0D);
    tessellator.addVertexWithUV((double) this.left, (double) (this.bottom - b0), 0.0D, 0.0D, 0.0D);
    tessellator.draw();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glShadeModel(GL11.GL_FLAT);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glDisable(GL11.GL_BLEND);

    FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;

    int titleWidth = fontRenderer.getStringWidth(title);
    fontRenderer.drawStringWithShadow(title, this.left + ((this.right - this.left) / 2) - (titleWidth / 2), this.top + 2, 0xFFFFFF);

    int topStart = this.top + 15;

    for (String line : lines)
    {
        if (centeredF)
        {
            int stringWidth = fontRenderer.getStringWidth(line);
            fontRenderer.drawStringWithShadow(line, this.left + ((this.right - this.left) / 2) - (stringWidth / 2), topStart, 0xFFFFFF);
        }
        else
        {
            fontRenderer.drawStringWithShadow(line, this.left, topStart, 0xFFFFFF);
        }
        topStart += 10;
    }

}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:71,代码来源:GuiWell.java

示例3: draw

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void draw(ShopGUI g, int page, int mouseX, int mouseY, float partialTicks, DrawType dt ) {
	
	super.draw(g, page, mouseX, mouseY, partialTicks, dt);
	
	if ( dt == DrawType.BG ) {
		
    	g . drawGradientRect(30, (int) (g . getScaledResolution ( ).getScaledHeight() * 0.1) + 19 + 20, g . getScaledResolution ( ).getScaledWidth() - 30, (int) ((g . getScaledResolution ( ).getScaledHeight()) - (g . getScaledResolution ( ).getScaledHeight() * 0.1)) - 5, -1072689136, -804253680);

	} else if ( dt == DrawType . POST ) {
		
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glShadeModel(GL11.GL_SMOOTH);
        GL11.glDisable(GL11.GL_TEXTURE_2D);

        //

        Tessellator var18 = Tessellator.instance;
        byte var20 = 12;

        var18.startDrawingQuads();

        var18.setColorRGBA_I(0, 0);

        var18.addVertexWithUV((double) 30, (double) ((int) (g . getScaledResolution ( ).getScaledHeight() * 0.1) + 19 + 20 + var20), 0.0D, 0.0D, 1.0D);
        var18.addVertexWithUV((double) (int) g . getScaledResolution ( ).getScaledWidth() - 30, (double) ((g . getScaledResolution ( ).getScaledHeight() * 0.1) + 19 + 20 + var20), 0.0D, 1.0D, 1.0D);

        var18.setColorRGBA_I(0, 105);

        var18.addVertexWithUV((double) g . getScaledResolution ( ).getScaledWidth() - 30, (double) (int) (g . getScaledResolution ( ).getScaledHeight() * 0.1) + 19 + 20, 0.0D, 1.0D, 0.0D);
        var18.addVertexWithUV((double) 30, (double) (int) (g . getScaledResolution ( ).getScaledHeight() * 0.1) + 19 + 20, 0.0D, 0.0D, 0.0D);

        var18.draw();


        var18.startDrawingQuads();

        var18.setColorRGBA_I(0, 105);

        var18.addVertexWithUV((double) 30, (double) ((g . getScaledResolution ( ).getScaledHeight()) - (g . getScaledResolution ( ).getScaledHeight() * 0.1)) - 5, 0.0D, 0.0D, 1.0D);
        var18.addVertexWithUV((double) g . getScaledResolution ( ).getScaledWidth() - 30, (double) ((g . getScaledResolution ( ).getScaledHeight()) - (g . getScaledResolution ( ).getScaledHeight() * 0.1)) - 5, 0.0D, 1.0D, 1.0D);

        var18.setColorRGBA_I(0, 0);

        var18.addVertexWithUV((double) g . getScaledResolution ( ).getScaledWidth() - 30, (double) (((g . getScaledResolution ( ).getScaledHeight()) - (g . getScaledResolution ( ).getScaledHeight() * 0.1)) - 5 - var20), 0.0D, 1.0D, 0.0D);
        var18.addVertexWithUV((double) 30, (double) (((g . getScaledResolution ( ).getScaledHeight()) - (g . getScaledResolution ( ).getScaledHeight() * 0.1)) - 5 - var20), 0.0D, 0.0D, 0.0D);

        var18.draw();

        //

        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glShadeModel(GL11.GL_FLAT);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_BLEND);

	}
	
	
}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:62,代码来源:ShopCategory.java


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