use of buildcraft.lib.client.guide.font.IFontRenderer in project BuildCraft by BuildCraft.
the class GuideChapter method isMouseInside.
protected boolean isMouseInside() {
IFontRenderer font = gui.getCurrentFont();
String text = chapter.text;
int width = (int) (font.getStringWidth(text) + getHoverWidth(0));
int y = gui.minY + 20 * (gui.getChapterIndex(this) + 1);
if (lastDrawn == EnumGuiSide.LEFT) {
int x = gui.minX - width - 4 + 11;
GuiRectangle drawRect = new GuiRectangle(x, y - 4, width + GuiGuide.CHAPTER_MARKER_LEFT.width, 16);
if (drawRect.contains(gui.mouse)) {
return true;
}
} else if (lastDrawn == EnumGuiSide.RIGHT) {
int x = gui.minX + GuiGuide.PAGE_LEFT.width + GuiGuide.PAGE_RIGHT.width - 11;
GuiRectangle drawRect = new GuiRectangle(x, y - 4, width + GuiGuide.CHAPTER_MARKER_RIGHT.width, 16);
if (drawRect.contains(gui.mouse)) {
return true;
}
}
return false;
}
Aggregations