Java Code Examples for net.minecraftforge.fml.client.config.GuiUtils#drawHoveringText()

The following examples show how to use net.minecraftforge.fml.client.config.GuiUtils#drawHoveringText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemTabInfo.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void renderHoverText(int posX, int posY, int xSize, int ySize, int guiWidth, int guiHeight, boolean isSelected, int mouseX, int mouseY) {
    String localizedText = I18n.format(nameLocale);
    Minecraft mc = Minecraft.getMinecraft();
    ScaledResolution resolution = new ScaledResolution(mc);
    GuiUtils.drawHoveringText(Lists.newArrayList(localizedText), mouseX, mouseY,
        resolution.getScaledWidth(), resolution.getScaledHeight(), -1, mc.fontRenderer);
}
 
Example 2
Source File: Widget.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
protected void drawHoveringText(ItemStack itemStack, List<String> tooltip, int maxTextWidth, int mouseX, int mouseY) {
    Minecraft mc = Minecraft.getMinecraft();
    GuiUtils.drawHoveringText(itemStack, tooltip, mouseX, mouseY,
         sizes.getScreenWidth(),
         sizes.getScreenHeight(), maxTextWidth, mc.fontRenderer);
}
 
Example 3
Source File: GuiElementBase.java    From WearableBackpacks with MIT License 5 votes vote down vote up
/** Draws this element's tooltip on the screen. Rendering and mouse
 *  position are global, not relative to this element's position. */
public void drawTooltip(int mouseX, int mouseY, int screenWidth, int screenHeight, float partialTicks) {
	if (!hasTooltip()) return;
	GuiUtils.drawHoveringText(getTooltip(),
		mouseX, mouseY, screenWidth, screenHeight,
		300, getFontRenderer());
}
 
Example 4
Source File: AdvancedTextWidget.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected void drawHoveringText(List<String> textLines, int x, int y, FontRenderer font) {
    GuiUtils.drawHoveringText(textLines, x, y, width, height, 256, font);
}