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


Java GuiScreen.drawTexturedModalRect方法代码示例

本文整理汇总了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);
}
 
开发者ID:NickAcPT,项目名称:Lithium-Forge,代码行数:26,代码来源:ButtonRenderer.java


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