- 477
- 7
- 51
Здравствуйте, как наверное вы поняли вопрос в заголовке, пытаюсь сделать закругленные края кнопке, в какую сторону копать?
public class ImageButton extends GuiButtonExt
{
private ResourceLocation TEXTURE = Сonfig.buttonCommand;
private ResourceLocation TEXTURE_ON_ACTION = Config.buttonCommand;
public ImageButton(int id, int xPos, int yPos, int widthIn, int heightIn, String displayString, ResourceLocation textureIn, ResourceLocation tectureActionIn, boolean isTexturedOnClick)
{
super(id, xPos, yPos, displayString);
if(textureIn != null) TEXTURE = textureIn;
if(tectureActionIn != null) TEXTURE_ON_ACTION =
this.width = widthIn;
this.height = heightIn;
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partial)
{
if (this.visible)
{
boolean mouseOnButton = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (mouseOnButton)
mc.getTextureManager().bindTexture(TEXTURE_ON_ACTION);
else
mc.getTextureManager().bindTexture(TEXTURE);
this.drawTexturedModalRect(this.x, this.y, 0, 0, width, height);
this.drawString(mc.fontRenderer, this.displayString, x + width / 2 - mc.fontRenderer.getStringWidth(displayString) / 2, y + 10, 128);
}
}
}
Нет, такой вариант будет рассмотрен самым последнимсвоей текстурой
своя кнопка, с обычным рендером цвета, мне нужно только закруглить края кнопке, но это либо через гл или тесселятор наверноехочешь сделать скруглённые края кнопки