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