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


Java Tessellator.setColorOpaque_I方法代码示例

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


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

示例1: renderQuad

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderQuad(Tessellator p_77017_1_, int p_77017_2_, int p_77017_3_, int p_77017_4_, int p_77017_5_, int p_77017_6_)
{
    p_77017_1_.startDrawingQuads();
    p_77017_1_.setColorOpaque_I(p_77017_6_);
    p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + 0), 0.0D);
    p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + p_77017_5_), 0.0D);
    p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + p_77017_5_), 0.0D);
    p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + 0), 0.0D);
    p_77017_1_.draw();
}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:11,代码来源:GuiItemEntryOfItemMerch.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: doRender_NeutralBeam

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void doRender_NeutralBeam(_ProjectileBase entity, double x, double y, double z, float yaw, float tick, float beamWidth) 
  {
  	//GL11.glPushMatrix();
  	
//float f2 = par9;// (float) player.innerRotation + par9;
float f3 = MathHelper.sin(tick * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F;

float xPosEnd = (float) (entity.ownerX - entity.posX - (entity.prevPosX - entity.posX) * (double) (1.0F - tick));
float yPosEnd = (float) ((double) f3 + entity.ownerY - entity.posY - (entity.prevPosY - entity.posY) * (double) (1.0F - tick));
float zPosEnd = (float) (entity.ownerZ - entity.posZ - (entity.prevPosZ - entity.posZ) * (double) (1.0F - tick));

//for rotation/distance
float f7 = MathHelper.sqrt_float(xPosEnd * xPosEnd + zPosEnd * zPosEnd);
float f8 = MathHelper.sqrt_float(xPosEnd * xPosEnd + yPosEnd * yPosEnd + zPosEnd * zPosEnd);

// Changing the starting point here slightly, so it doesn't come out of the center
//int distance = 6;	// Increasing this will likely increase the distance
//double adjustmentZ = -MathHelper.cos((entity.shootingEntity.rotationYaw) * (float)Math.PI / 180.0F) * (distance * 0.08);
//double adjustmentX = MathHelper.sin((entity.shootingEntity.rotationYaw) * (float)Math.PI / 180.0F) * (distance * 0.08);

// Start drawing (i think)
GL11.glTranslated((float) x, (float) y, (float) z);	// Adjusted with distance to shooter
GL11.glRotatef((float) (-Math.atan2((double) zPosEnd, (double) xPosEnd)) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef((float) (-Math.atan2((double) f7, (double) yPosEnd)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.instance;

//Makes the beam look nice
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_CULL_FACE);

//Shading?
GL11.glShadeModel(GL11.GL_SMOOTH);

//from what i can tell f9 and f10 make the beam change (looks like its rotating or whatnot)
float f9 = 0.0F - ((float) entity.ticksExisted + tick) * 0.01F;
float f10 = MathHelper.sqrt_float(xPosEnd * xPosEnd + yPosEnd * yPosEnd + zPosEnd * zPosEnd) / 32.0F - ((float) entity.ticksExisted + tick) * 0.01F;

// change draw mode
tessellator.startDrawing(5);
byte b0 = 8;	// how many sides the circle has?

//float beamWidth = 0.15f;

for (int i = 0; i <= b0; ++i) 	// makes one side circular(fancy math stuff)
{
       float f11 = MathHelper.sin((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * beamWidth;		// "changing the 2 or .75 should change size of circle"
       float f12 = MathHelper.cos((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * beamWidth;		// The 2 seems to be there to describe a full circle
       float f13 = (float) (i % b0) * 1.0F / (float) b0;												// 1 makes it a half circle
       tessellator.setColorOpaque_I(0);
       tessellator.addVertexWithUV((double) (f11 * 0.2F), (double) (f12 * 0.2F), 0.0D, (double) f13, (double) f10);	// Now how do I shorten the beam slightly
       tessellator.setColorOpaque_I(16777215);																			// so it doesn't appear from the center of the shooter
       tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);				
}

tessellator.draw();	// draw added vertices
  
// reset openGl stuff?
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
RenderHelper.enableStandardItemLighting();
  	
  	GL11.glPopMatrix();
  }
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:65,代码来源:Render_Projectile.java

示例4: draw

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void draw(Tessellator tessellator, IIcon icon, int brightness, int metadata) {
	GL11.glPushMatrix();
	GL11.glDisable(GL11.GL_LIGHTING);
	Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(0, 0, 0, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(0, 1, 0, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 1, 0, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 0, 0, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(1, 0, 0, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(1, 1, 0, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 1, 1, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 0, 1, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(1, 0, 1, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(1, 1, 1, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 1, 1, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 0, 1, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(0, 0, 1, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(0, 1, 1, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 1, 0, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 0, 0, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(1, 1, 1, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(1, 1, 0, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 1, 0, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(0, 1, 1, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setColorOpaque_I(BlockCustomOreItem.colors[metadata + 1]);
	tessellator.setBrightness(Math.max(brightness, 160));
	tessellator.addVertexWithUV(0, 0, 1, icon.getMaxU(), icon.getMaxV());
	tessellator.addVertexWithUV(0, 0, 0, icon.getMaxU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 0, 0, icon.getMinU(), icon.getMinV());
	tessellator.addVertexWithUV(1, 0, 1, icon.getMinU(), icon.getMaxV());
	tessellator.draw();
	GL11.glEnable(GL11.GL_LIGHTING);
	GL11.glPopMatrix();
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:56,代码来源:TileInfusedBlockOreRenderer.java


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