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


Java EnumChatFormatting.ITALIC属性代码示例

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


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

示例1: func_181551_a

public void func_181551_a(ScaledResolution p_181551_1_) {
	this.mc.mcProfiler.startSection("selectedItemName");

	if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) {
		String s = this.highlightingItemStack.getDisplayName();

		if (this.highlightingItemStack.hasDisplayName()) {
			s = EnumChatFormatting.ITALIC + s;
		}

		int i = (p_181551_1_.getScaledWidth() - this.getFontRenderer().getStringWidth(s)) / 2;
		int j = p_181551_1_.getScaledHeight() - 59;

		if (!this.mc.playerController.shouldDrawHUD()) {
			j += 14;
		}

		int k = (int) ((float) this.remainingHighlightTicks * 256.0F / 10.0F);

		if (k > 255) {
			k = 255;
		}

		if (k > 0) {
			GlStateManager.pushMatrix();
			GlStateManager.enableBlend();
			GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
			this.getFontRenderer().drawStringWithShadow(s, (float) i, (float) j, 16777215 + (k << 24));
			GlStateManager.disableBlend();
			GlStateManager.popMatrix();
		}
	}

	this.mc.mcProfiler.endSection();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:35,代码来源:GuiIngame.java

示例2: func_181551_a

public void func_181551_a(ScaledResolution p_181551_1_)
{
    this.mc.mcProfiler.startSection("selectedItemName");

    if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null)
    {
        String s = this.highlightingItemStack.getDisplayName();

        if (this.highlightingItemStack.hasDisplayName())
        {
            s = EnumChatFormatting.ITALIC + s;
        }

        int i = (p_181551_1_.getScaledWidth() - this.getFontRenderer().getStringWidth(s)) / 2;
        int j = p_181551_1_.getScaledHeight() - 59;

        if (!this.mc.playerController.shouldDrawHUD())
        {
            j += 14;
        }

        int k = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F);

        if (k > 255)
        {
            k = 255;
        }

        if (k > 0)
        {
            GlStateManager.pushMatrix();
            GlStateManager.enableBlend();
            GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
            this.getFontRenderer().drawStringWithShadow(s, (float)i, (float)j, 16777215 + (k << 24));
            GlStateManager.disableBlend();
            GlStateManager.popMatrix();
        }
    }

    this.mc.mcProfiler.endSection();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:41,代码来源:GuiIngame.java


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