本文整理了Java中net.minecraft.client.gui.Gui.drawTexturedModalRect()
方法的一些代码示例,展示了Gui.drawTexturedModalRect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gui.drawTexturedModalRect()
方法的具体详情如下:
包路径:net.minecraft.client.gui.Gui
类名称:Gui
方法名:drawTexturedModalRect
暂无
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderTopRightCorner(Gui gui, int width) {
gui.drawTexturedModalRect(width - 3, 0, u + 5, v, 3, 3);
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderBottomLeftCorner(Gui gui, int height) {
gui.drawTexturedModalRect(0, height - 3, u + 11, v, 3, 3);
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderTopLeftCorner(Gui gui) {
gui.drawTexturedModalRect(0, 0, u, v, 4, 4);
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderBottomRightCorner(Gui gui, int width, int height) {
gui.drawTexturedModalRect(width - 4, height - 4, u + 15, v, 4, 4);
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderTopEdge(Gui gui, int width) {
GL11.glPushMatrix();
GL11.glTranslatef(4, 0, 0);
GL11.glScaled(width - 7, 1, 0);
gui.drawTexturedModalRect(0, 0, u + 4, v, 1, 3);
GL11.glPopMatrix();
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderLeftEdge(Gui gui, int height) {
GL11.glPushMatrix();
GL11.glTranslatef(0, 4, 0);
GL11.glScaled(1, height - 7, 0);
gui.drawTexturedModalRect(0, 0, u, v + 4, 3, 1);
GL11.glPopMatrix();
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderRightEdge(Gui gui, int width, int height) {
GL11.glPushMatrix();
GL11.glTranslatef(width - 3, 3, 0);
GL11.glScaled(1, height - 7, 0);
gui.drawTexturedModalRect(0, 0, u + 8, v, 3, 1);
GL11.glPopMatrix();
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderBackground(Gui gui, int width, int height) {
GL11.glPushMatrix();
GL11.glTranslatef(2, 2, 0);
GL11.glScalef(width - 4, height - 4, 0);
gui.drawTexturedModalRect(0, 0, u + 19, v, 1, 1);
GL11.glPopMatrix();
}
代码示例来源:origin: OpenMods/OpenModsLib
protected void renderBottomEdge(Gui gui, int width, int height) {
GL11.glPushMatrix();
GL11.glTranslatef(3, height - 3, 0);
GL11.glScaled(width - 7, 1, 0);
gui.drawTexturedModalRect(0, 0, u + 14, v, 1, 3);
GL11.glPopMatrix();
}
代码示例来源:origin: SleepyTrousers/EnderIO
public static void render(@Nonnull Gui gui, int x, int y, int length, @Nonnull ExperienceContainer xpCont, int required) {
String text = xpCont.getExperienceLevel() + "";
int color = 8453920;
boolean shadow = true;
if (required > 0) {
text += "/" + required;
if (required > xpCont.getExperienceLevel()) {
color = ColorUtil.getRGB(1f, 0, 0.1f);
shadow = false;
}
}
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
int strX = x + length / 2 - fr.getStringWidth(text) / 2;
fr.drawString(text, strX, y - 11, color, shadow);
RenderUtil.bindTexture(IconEIO.TEXTURE);
GlStateManager.color(1f, 1f, 1f, 1f);
int xpScaled = xpCont.getXpBarScaled(length - 2);
// x, y, u, v, width, height
// start of 'slot'
gui.drawTexturedModalRect(x, y, 0, 91, 1, 5);
gui.drawTexturedModalRect(x + 1, y, 1, 91, length - 2, 5);
gui.drawTexturedModalRect(x + length - 1, y, 125, 91, 1, 5);
RenderUtil.renderQuad2D(x + 1, y + 1, 0, xpScaled, 3, ColorUtil.getRGB(0, 127, 14));
}
内容来源于网络,如有侵权,请联系作者删除!