本文整理匯總了Java中net.minecraft.util.text.TextFormatting.UNDERLINE屬性的典型用法代碼示例。如果您正苦於以下問題:Java TextFormatting.UNDERLINE屬性的具體用法?Java TextFormatting.UNDERLINE怎麽用?Java TextFormatting.UNDERLINE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.text.TextFormatting
的用法示例。
在下文中一共展示了TextFormatting.UNDERLINE屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawButton
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) {
if (this.visible) {
FontRenderer fontrenderer = mc.fontRenderer;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.x && mouseY >= this.y
&& mouseX < this.x + this.width && mouseY < this.y + this.height;
int i = this.getHoverState(this.hovered);
this.mouseDragged(mc, mouseX, mouseY);
int j = 0;
String p = "";
if (!this.enabled) {
j = 10526880;
} else if (this.hovered) {
j = 1450415;
p += TextFormatting.UNDERLINE;
}
fontrenderer.drawString(p + I18n.format(this.displayString), this.x, this.y, j);
}
}
示例2: drawScreen
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(BACKGROUND);
this.drawTexturedModalRect(left, top, 0, 0, WIDTH, HEIGHT);
if (currentPage != null) {
String header = TextFormatting.BOLD + "" + TextFormatting.UNDERLINE + I18n.format(currentPage.getTitle());
int headerWidth = this.fontRenderer.getStringWidth(header);
this.fontRenderer.drawString(header, left + (WIDTH - headerWidth) / 2, top + 12, 0);
if (currentPage instanceof BookPageItemDisplay) {
renderItemDisplayPage((BookPageItemDisplay) currentPage, mouseX, mouseY);
} else if (currentPage instanceof BookPageMat) {
renderMatPage((BookPageMat) currentPage, mouseX, mouseY);
} else if (currentPage instanceof BookPageText) {
renderTextPage((BookPageText) currentPage, mouseX, mouseY);
}
if (chapters.get(currentChapter).getPageCount() > 1) {
GlStateManager.pushMatrix();
float textScale = 0.5F;
GlStateManager.scale(textScale, textScale, textScale);
String pageNum = (currentPageNum + 1) + "/" + chapters.get(currentChapter).getPageCount();
int pageNumWidth = (int) (this.fontRenderer.getStringWidth(pageNum) * textScale);
int x = (int) ((left + (WIDTH - pageNumWidth) / 2) / textScale);
this.fontRenderer.drawString(pageNum, x, (int) ((top + 164) / textScale), 0);
GlStateManager.popMatrix();
}
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
示例3: drawListHeader
/**
* Handles drawing a list's header row.
*/
protected void drawListHeader(int insideLeft, int insideTop, Tessellator tessellatorIn)
{
String s = TextFormatting.UNDERLINE + "" + TextFormatting.BOLD + this.getListHeader();
this.mc.fontRendererObj.drawString(s, insideLeft + this.width / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, Math.min(this.top + 3, insideTop), 16777215);
}
示例4: commandEmphasized
public String commandEmphasized(String text)
{
return C_CMD + TextFormatting.UNDERLINE + text + TextFormatting.RESET + " ";
}