Java Code Examples for com.mojang.blaze3d.platform.GlStateManager#scalef()
The following examples show how to use
com.mojang.blaze3d.platform.GlStateManager#scalef() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderHelper.java From BoundingBoxOutlineReloaded with MIT License | 5 votes |
public static void beforeRenderFont(OffsetPoint offsetPoint) { disableDepthTest(); GlStateManager.pushMatrix(); polygonModeFill(); GlStateManager.translated(offsetPoint.getX(), offsetPoint.getY() + 0.002D, offsetPoint.getZ()); GlStateManager.normal3f(0.0F, 1.0F, 0.0F); GlStateManager.rotatef(0.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotatef(90.0F, 1.0F, 0.0F, 0.0F); GlStateManager.scalef(-0.0175F, -0.0175F, 0.0175F); enableTexture(); enableBlend(); GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); depthMaskTrue(); }
Example 2
Source File: SandboxTitleScreen.java From Sandbox with GNU Lesser General Public License v3.0 | 4 votes |
public void render(int int_1, int int_2, float float_1) { if (this.backgroundFadeStart == 0L && this.doBackgroundFade) { this.backgroundFadeStart = Util.getMeasuringTimeMs(); } float float_2 = this.doBackgroundFade ? (float) (Util.getMeasuringTimeMs() - this.backgroundFadeStart) / 1000.0F : 1.0F; fill(0, 0, this.width, this.height, -1); this.backgroundRenderer.render(float_1, MathHelper.clamp(float_2, 0.0F, 1.0F)); int int_4 = this.width / 2 - 137; this.minecraft.getTextureManager().bindTexture(PANORAMA_OVERLAY); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA.value, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA.value); GlStateManager.color4f(1.0F, 1.0F, 1.0F, this.doBackgroundFade ? (float) MathHelper.ceil(MathHelper.clamp(float_2, 0.0F, 1.0F)) : 1.0F); blit(0, 0, this.width, this.height, 0.0F, 0.0F, 16, 128, 16, 128); float float_3 = this.doBackgroundFade ? MathHelper.clamp(float_2 - 1.0F, 0.0F, 1.0F) : 1.0F; int int_6 = MathHelper.ceil(float_3 * 255.0F) << 24; if ((int_6 & -67108864) != 0) { this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURE); GlStateManager.color4f(1.0F, 1.0F, 1.0F, float_3); if (this.field_17776) { this.blit(int_4 + 0, 30, 0, 0, 99, 44); this.blit(int_4 + 99, 30, 129, 0, 27, 44); this.blit(int_4 + 99 + 26, 30, 126, 0, 3, 44); this.blit(int_4 + 99 + 26 + 3, 30, 99, 0, 26, 44); this.blit(int_4 + 155, 30, 0, 45, 155, 44); } else { this.blit(int_4 + 0, 30, 0, 0, 155, 44); this.blit(int_4 + 155, 30, 0, 45, 155, 44); } this.minecraft.getTextureManager().bindTexture(EDITION_TITLE_TEXTURE); blit(int_4 + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16); if (this.splashText != null) { GlStateManager.pushMatrix(); GlStateManager.translatef((float) (this.width / 2 + 90), 70.0F, 0.0F); GlStateManager.rotatef(-20.0F, 0.0F, 0.0F, 1.0F); float float_4 = 1.8F - MathHelper.abs(MathHelper.sin((float) (Util.getMeasuringTimeMs() % 1000L) / 1000.0F * 6.2831855F) * 0.1F); float_4 = float_4 * 100.0F / (float) (this.font.getStringWidth(this.splashText) + 32); GlStateManager.scalef(float_4, float_4, float_4); this.drawCenteredString(this.font, this.splashText, 0, -8, 16776960 | int_6); GlStateManager.popMatrix(); } String string_1 = "Minecraft " + SharedConstants.getGameVersion().getName(); if (this.minecraft.isDemo()) { string_1 = string_1 + " Demo"; } else { string_1 = string_1 + ("release".equalsIgnoreCase(this.minecraft.getVersionType()) ? "" : "/" + this.minecraft.getVersionType()); } this.drawString(this.font, string_1, 2, this.height - 10, 16777215 | int_6); this.drawString(this.font, "Copyright Mojang AB. Do not distribute!", this.copyrightTextX, this.height - 10, 16777215 | int_6); if (int_1 > this.copyrightTextX && int_1 < this.copyrightTextX + this.copyrightTextWidth && int_2 > this.height - 10 && int_2 < this.height) { fill(this.copyrightTextX, this.height - 1, this.copyrightTextX + this.copyrightTextWidth, this.height, 16777215 | int_6); } if (this.warning != null) { this.warning.render(int_6); } Iterator var11 = this.buttons.iterator(); while (var11.hasNext()) { AbstractButtonWidget abstractButtonWidget_1 = (AbstractButtonWidget) var11.next(); abstractButtonWidget_1.setAlpha(float_3); } super.render(int_1, int_2, float_1); } }