本文整理汇总了Java中net.minecraft.client.gui.FontRenderer.setUnicodeFlag方法的典型用法代码示例。如果您正苦于以下问题:Java FontRenderer.setUnicodeFlag方法的具体用法?Java FontRenderer.setUnicodeFlag怎么用?Java FontRenderer.setUnicodeFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.gui.FontRenderer
的用法示例。
在下文中一共展示了FontRenderer.setUnicodeFlag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerFontRenderer
import net.minecraft.client.gui.FontRenderer; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void registerFontRenderer(Minecraft mc, FontRenderer renderer) throws Exception {
if (mc.gameSettings.language != null) {
renderer.setUnicodeFlag(mc.isUnicode());
renderer.setBidiFlag(mc.getLanguageManager().isCurrentLanguageBidirectional());
}
((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(renderer);
}
示例2: renderItemOverlayIntoGUI
import net.minecraft.client.gui.FontRenderer; //导入方法依赖的package包/类
@Override
public void renderItemOverlayIntoGUI(FontRenderer fontRenderer, @Nonnull ItemStack is, int par4, int par5, String par6Str) {
if (!is.isEmpty() && !dankNull.isEmpty()) {
float scaleFactor = useLg ? 1.0F : 0.5F;
float inverseScaleFactor = 1.0F / scaleFactor;
int offset = useLg ? 0 : -1;
String stackSize = "";
boolean unicodeFlag = fontRenderer.getUnicodeFlag();
fontRenderer.setUnicodeFlag(false);
if (is.getItem().showDurabilityBar(is)) {
double health = is.getItem().getDurabilityForDisplay(is);
int j = (int) Math.round(13.0D - health * 13.0D);
int i = (int) Math.round(255.0D - health * 255.0D);
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
draw(vertexbuffer, par4 + 2, par5 + 13, 13, 2, 0, 0, 0, 255);
draw(vertexbuffer, par4 + 2, par5 + 13, 12, 1, (255 - i) / 4, 64, 0, 255);
draw(vertexbuffer, par4 + 2, par5 + 13, j, 1, 255 - i, i, 0, 255);
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
}
int amount = 0;
amount = is.getCount();
if (container != null) {
//amount = container.getDankNullInventory().getSizeForSlot(DankNullUtils.getIndexForStack(container.getDankNullInventory(), is));
}
if (amount < 0 || amount > 127) {
//amount = (byte) amount & (0xff);
}
if (amount != 0) {
scaleFactor = 0.5F;
inverseScaleFactor = 1.0F / scaleFactor;
offset = -1;
stackSize = getToBeRenderedStackSize(amount);
}
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
GlStateManager.disableDepth();
GlStateManager.pushMatrix();
GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);
int X = (int) ((par4 + offset + 16.0F - fontRenderer.getStringWidth(stackSize) * scaleFactor) * inverseScaleFactor);
int Y = (int) ((par5 + offset + 16.0F - 7.0F * scaleFactor) * inverseScaleFactor);
if (amount > 1L) {
fontRenderer.drawStringWithShadow(stackSize, X, Y, 16777215);
}
GlStateManager.popMatrix();
GlStateManager.enableDepth();
GlStateManager.enableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableLighting();
fontRenderer.setUnicodeFlag(unicodeFlag);
}
}
示例3: renderItem
import net.minecraft.client.gui.FontRenderer; //导入方法依赖的package包/类
protected void renderItem(RenderItem renderer, FontRenderer font, ItemStack stack, int x, int y) {
font.setUnicodeFlag(false);
renderer.renderItemAndEffectIntoGUI(stack, x, y);
renderer.renderItemOverlays(font, stack, x, y);
font.setUnicodeFlag(true);
}