use of net.minecraft.client.renderer.Tessellator in project Guide-API by TeamAmeriFrance.
the class GuiBase method drawTexturedModalRectWithColor.
public void drawTexturedModalRectWithColor(int x, int y, int textureX, int textureY, int width, int height, Color color) {
pushMatrix();
enableBlend();
blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float f = 0.00390625F;
float f1 = 0.00390625F;
disableLighting();
color((float) color.getRed() / 255F, (float) color.getGreen() / 255F, (float) color.getBlue() / 255F);
Tessellator tessellator = Tessellator.getInstance();
tessellator.getBuffer().begin(7, DefaultVertexFormats.POSITION_TEX);
tessellator.getBuffer().pos((double) (x), (double) (y + height), (double) this.zLevel).tex((double) ((float) (textureX) * f), (double) ((float) (textureY + height) * f1)).endVertex();
tessellator.getBuffer().pos((double) (x + width), (double) (y + height), (double) this.zLevel).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + height) * f1)).endVertex();
tessellator.getBuffer().pos((double) (x + width), (double) (y), (double) this.zLevel).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY) * f1)).endVertex();
tessellator.getBuffer().pos((double) (x), (double) (y), (double) this.zLevel).tex((double) ((float) (textureX) * f), (double) ((float) (textureY) * f1)).endVertex();
tessellator.draw();
disableBlend();
popMatrix();
}
use of net.minecraft.client.renderer.Tessellator in project Guide-API by TeamAmeriFrance.
the class GuiHelper method drawSizedIconWithColor.
/**
* @param x - The position on the x-axis to draw the icon
* @param y - The position on the y-axis to draw the icon
* @param width - The width of the icon
* @param height - The height of the icon
* @param color - The color the icon will have
*/
public static void drawSizedIconWithColor(int x, int y, int width, int height, float zLevel, Color color) {
pushMatrix();
enableBlend();
blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
scale(0.5D, 0.5D, 0.5D);
color((float) color.getRed() / 255F, (float) color.getGreen() / 255F, (float) color.getBlue() / 255F, (float) color.getAlpha() / 255F);
translate(x, y, zLevel);
RenderHelper.enableGUIStandardItemLighting();
disableLighting();
enableRescaleNormal();
enableDepth();
Tessellator tessellator = Tessellator.getInstance();
tessellator.getBuffer().begin(7, DefaultVertexFormats.POSITION_TEX);
tessellator.getBuffer().pos(x, y + height, zLevel).tex(0D, 1D).endVertex();
tessellator.getBuffer().pos(x + width, y + height, zLevel).tex(1D, 1D).endVertex();
tessellator.getBuffer().pos(x + width, y, zLevel).tex(1D, 0D).endVertex();
tessellator.getBuffer().pos(x, y, zLevel).tex(0D, 0D).endVertex();
tessellator.draw();
RenderHelper.disableStandardItemLighting();
popMatrix();
}
use of net.minecraft.client.renderer.Tessellator in project Guide-API by TeamAmeriFrance.
the class GuiHelper method drawIconWithoutColor.
/**
* @param x - The position on the x-axis to draw the icon
* @param y - The position on the y-axis to draw the icon
* @param width - The width of the icon
* @param height - The height of the icon
* @param zLevel -
*/
public static void drawIconWithoutColor(int x, int y, int width, int height, float zLevel) {
pushMatrix();
enableBlend();
blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
disableLighting();
enableRescaleNormal();
enableDepth();
Tessellator tessellator = Tessellator.getInstance();
tessellator.getBuffer().begin(7, DefaultVertexFormats.POSITION_TEX);
tessellator.getBuffer().pos(x, y + height, zLevel).tex(0D, 1D).endVertex();
tessellator.getBuffer().pos(x + width, y + height, zLevel).tex(1D, 1D).endVertex();
tessellator.getBuffer().pos(x + width, y, zLevel).tex(1D, 0D).endVertex();
tessellator.getBuffer().pos(x, y, zLevel).tex(0D, 0D).endVertex();
tessellator.draw();
RenderHelper.disableStandardItemLighting();
popMatrix();
}
use of net.minecraft.client.renderer.Tessellator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EventsClient method onDrawBlockHighlightEventFirst.
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onDrawBlockHighlightEventFirst(DrawBlockHighlightEvent event) {
BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
if (pos != null) {
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(Minecraft.getMinecraft().theWorld, pos);
if (wrapper != null && wrapper.wrapping != null && wrapper.wrapping.renderer != null && wrapper.wrapping.centerCoord != null) {
// GL11.glPushMatrix();
float partialTicks = event.getPartialTicks();
Entity player = Minecraft.getMinecraft().thePlayer;
wrapper.wrapping.renderer.setupTranslation(partialTicks);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
double xOff = (player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getX();
double yOff = (player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getY();
double zOff = (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getZ();
vertexbuffer.xOffset += xOff;
vertexbuffer.yOffset += yOff;
vertexbuffer.zOffset += zOff;
}
}
}
use of net.minecraft.client.renderer.Tessellator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class CallRunnerClient method onDrawSelectionBox.
public static void onDrawSelectionBox(RenderGlobal renderGlobal, EntityPlayer player, RayTraceResult movingObjectPositionIn, int execute, float partialTicks) {
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(player.worldObj, movingObjectPositionIn.getBlockPos());
if (wrapper != null && wrapper.wrapping != null && wrapper.wrapping.renderer != null && wrapper.wrapping.renderer.offsetPos != null) {
;
wrapper.wrapping.renderer.setupTranslation(partialTicks);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
double xOff = (player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getX();
double yOff = (player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getY();
double zOff = (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks) - wrapper.wrapping.renderer.offsetPos.getZ();
vertexbuffer.xOffset += xOff;
vertexbuffer.yOffset += yOff;
vertexbuffer.zOffset += zOff;
renderGlobal.drawSelectionBox(player, movingObjectPositionIn, execute, partialTicks);
vertexbuffer.xOffset -= xOff;
vertexbuffer.yOffset -= yOff;
vertexbuffer.zOffset -= zOff;
wrapper.wrapping.renderer.inverseTransform(partialTicks);
} else {
renderGlobal.drawSelectionBox(player, movingObjectPositionIn, execute, partialTicks);
}
}
Aggregations