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


Java GuiUtils.drawTexturedModalRect方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.client.config.GuiUtils.drawTexturedModalRect方法的典型用法代码示例。如果您正苦于以下问题:Java GuiUtils.drawTexturedModalRect方法的具体用法?Java GuiUtils.drawTexturedModalRect怎么用?Java GuiUtils.drawTexturedModalRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.client.config.GuiUtils的用法示例。


在下文中一共展示了GuiUtils.drawTexturedModalRect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawTwitch

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
private static void drawTwitch()
{
    if(tsize == 3){
        textU = 0;
        textV = 0;
    }else if(tsize == 2){
        textU = 0;
        textV = 38;
    }else if(tsize == 1){
        textU = -1;
        textV = 87;
    }else{
        textU = 0;
        textV = 0;
    }
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:21,代码来源:TCDrawScreen.java

示例2: drawLive

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
private static void drawLive()
{
    if(tsize == 3){
        textLU = 24;
        textLV = 0;
    }else if(tsize == 2){
        textLU = 25;
        textLV = 38;
    }else if(tsize == 1){
        textLU = 26;
        textLV = 87;
    }else{
        textU = 0;
        textV = 0;
    }
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:21,代码来源:TCDrawScreen.java

示例3: drawIcon

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
private static void drawIcon()
{
    if(!Twitchy.persistantIcon && !Twitchy.isLive) return;
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
    if(Twitchy.isLive)
        GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:11,代码来源:TCDrawScreen.java

示例4: drawGui

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
public void drawGui(float partialTicks)
{
	Minecraft mc = Minecraft.getMinecraft();
	ScaledResolution res = new ScaledResolution(mc);

	Minecraft.getMinecraft().renderEngine.bindTexture(elements);

	ItemStack shieldStack = EntityUtil.getActivePlayerShield(mc.player);
	ItemAnimaShield shieldItem = (ItemAnimaShield) shieldStack.getItem();

	float currentCharge = shieldItem.getShieldCharge(shieldStack);
	float maxCharge = shieldItem.getMaxShieldCharge(shieldStack);

	if(startingCharge == -1)
		startingCharge = currentCharge;

	if(currentCharge == maxCharge || startingCharge == currentCharge)
	{
		moveSecondary = true;
	}
	boolean drawFill = currentCharge > 0;

	int asPercent = drawFill ? (int) ((currentCharge * 100)/ maxCharge) : 999;
	float fillWidth = maxBarWidth - (int) (maxBarWidth * ((float)asPercent/100));

	boolean drawSecondary = secondaryWidth != fillWidth && moveSecondary;

	int drawWidth = maxBarWidth - (int)fillWidth;

	GuiUtils.drawTexturedModalRect(getStartX(res), getStartY(res), 0, 16, 92, 10, 400);
	if(drawSecondary)
		GuiUtils.drawTexturedModalRect(getStartX(res) + 1, getStartY(res) + 1, 0, 8 , secondaryWidth, 8, 400);
	if(drawFill)
		GuiUtils.drawTexturedModalRect(getStartX(res) + 1, getStartY(res) + 1, 0, 0 ,  drawWidth,8, 400);

}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:37,代码来源:GuiShield.java

示例5: draw

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
public void draw(ProgressBarSource progressSource)
{
    float progress = progressSource.getProgress(this.source);

    int w = direction.getWidth(width, progress);
    int h = direction.getHeight(height, progress);

    int offsetX = direction.getOffsetX(width, w);
    int offsetY = direction.getOffsetY(height, h);

    GuiUtils.drawTexturedModalRect(x + offsetX, y + offsetY, texX + offsetX, texY + offsetY, w, h, 0f);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:13,代码来源:ProgressBar.java

示例6: renderEffect

import net.minecraftforge.fml.client.config.GuiUtils; //导入方法依赖的package包/类
private static void renderEffect(int x, int y, int width, int height, float opacity) {
	if (opacity <= 0) return;
	Minecraft mc = Minecraft.getMinecraft();
	float animProgress = Minecraft.getSystemTime() / 400.0F;
	
	int color = 0xFF8040CC;
	float r = (color >> 16 & 0xFF) / 255.0F;
	float g = (color >> 8 & 0xFF) / 255.0F;
	float b = (color & 0xFF) / 255.0F;
	GlStateManager.color(r, g, b, opacity * 0.6F);
	
	mc.getTextureManager().bindTexture(ENCHANTED_ITEM_GLINT);
	
	GlStateManager.enableBlend();
	GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
	GlStateManager.enableAlpha();
	GlStateManager.alphaFunc(GL11.GL_ALWAYS, 0.0F);
	
	for (int i = 0; i < 2; ++i) {
		GlStateManager.matrixMode(GL11.GL_TEXTURE);
		GlStateManager.loadIdentity();
		GlStateManager.rotate(30.0F - i * 60.0F, 0.0F, 0.0F, 1.0F);
		GlStateManager.translate(0.0F, animProgress * (0.001F + i * 0.003F) * 20.0F, 0.0F);
		GlStateManager.matrixMode(GL11.GL_MODELVIEW);
		GuiUtils.drawTexturedModalRect(x, y, 0, 0, width, height, 0);
	}
	
	GlStateManager.matrixMode(GL11.GL_TEXTURE);
	GlStateManager.loadIdentity();
	GlStateManager.matrixMode(GL11.GL_MODELVIEW);
	
	GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
	GlStateManager.disableAlpha();
	GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
	GlStateManager.disableBlend();
}
 
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:37,代码来源:EntryValueEffectOpacity.java


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