Java tutorial
/** * This class was created by <SR2610>. It is distributed as * part of the Steampunk'd Mod. Get the Source Code on Github: * https://github.com/SR2610/Steampunkd. * * Steampunk'd is Open Source and distributed under a Creative Commons * Attribution-NonCommercial-ShareAlike 3.0 License * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) */ package com.sr2610.steampunkd.client.gui.handbook.buttons; import org.lwjgl.opengl.GL11; import com.sr2610.steampunkd.client.gui.handbook.GuiHandbook; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; public class GuiNavigationButton extends GuiButton { boolean right; public GuiNavigationButton(int buttonID, int x, int y, boolean isRight) { super(buttonID, x, y, 18, 10, ""); right = isRight; } @Override public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (enabled) { hovered = (mouseX >= xPosition) && (mouseY >= yPosition) && (mouseX < (xPosition + width)) && (mouseY < (yPosition + height)); final int hoveredState = getHoverState(hovered); minecraft.renderEngine.bindTexture(GuiHandbook.texture); GL11.glColor4f(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, hoveredState == 2 ? 18 : 0, right ? 180 : 190, 18, 10); } } }