1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package jp.plusplus.fbs.gui.button;
import jp.plusplus.fbs.FBS;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
/**
* Created by plusplus_F on 2015/10/21.
*/
public class GuiButtonEnchantment extends GuiButton {
public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/enchant.png");
public GuiButtonEnchantment(int id, int x, int y) {
super(id, x, y, 28, 23, "");
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if (this.visible) {
par1Minecraft.getTextureManager().bindTexture(rl);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
int drawX = 176;
int drawY = 0;
if (!this.enabled) drawY += height * 2;
else if (onMouse) drawY += height;
this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
}
}
}
|