本文整理汇总了Java中net.minecraft.client.gui.GuiScreen.drawTexturedModalRect方法的典型用法代码示例。如果您正苦于以下问题:Java GuiScreen.drawTexturedModalRect方法的具体用法?Java GuiScreen.drawTexturedModalRect怎么用?Java GuiScreen.drawTexturedModalRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.gui.GuiScreen
的用法示例。
在下文中一共展示了GuiScreen.drawTexturedModalRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawButton
import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
/**
* Draws this button to the screen.
*/
@SideOnly(Side.CLIENT)
public static void drawButton(GuiScreen gui, String displayString, int mouseX, int mouseY, int x, int y, int width, int height) {
int i = 1; //Hover state
int j = 14737632; // ?
FontRenderer fontrenderer = ModCoderPackUtils.getFontRenderer();
ModCoderPackUtils.getMinecraft().getTextureManager().bindTexture(BUTTON_TEXTURES);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
gui.drawTexturedModalRect(x, y, 0, 46 + i * 20, width / 2, ((int)Math.ceil(height /2))); //LEFT TOP
gui.drawTexturedModalRect(x, y + (height / 2), 0, 46 + i * 20 + 20 - height /2, width / 2, height / 2); //LEFT TOP
gui.drawTexturedModalRect(x + width / 2, y, 200 - width / 2, 46 + i * 20, width / 2, ((int)Math.ceil(height /2))); //RIGHT TOP
gui.drawTexturedModalRect(x + width / 2, y + (height / 2), 200 - width / 2, 46 + i * 20 + 20 - height /2, width / 2, height / 2); //RIGHT TOP
//gui.drawTexturedModalRect(x + width / 2, y, 200 - width / 2, 46 + i * 20, width / 2, height);
gui.drawCenteredString(fontrenderer, displayString, x + width / 2, y + (height - 8) / 2, j);
}