本文整理匯總了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();
}
示例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();
}