Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3)
{
if (this.drawButton)
{
if (this.dragging)
{
this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8);
if (this.sliderValue < 0.0F)
{
this.sliderValue = 0.0F;
}
if (this.sliderValue > 1.0F)
{
this.sliderValue = 1.0F;
}
par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue);
this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20);
this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
}
}
В нем есть тот метод. который ты сказал.Agravaine написал(а):Причем тут вообще слайдер?
public void drawBackground(int par1)
{
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.instance;
this.mc.renderEngine.bindTexture("/gui/background.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float f = 32.0F;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(4210752);
tessellator.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / f + (float)par1));
tessellator.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / f), (double)((float)this.height / f + (float)par1));
tessellator.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / f), (double)par1);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)par1);
tessellator.draw();
}