Here is:
public static void renderButton(ByteBuffer preicon, String text, String font, float x, float y, float w, float h,
NVGColor color, boolean mouseInside) {
long vg = Display.getVg();
NVGPaint bg = paintA;
float cornerRadius = 4.0f;
float tw, iw = 0;
if (mouseInside) {
x += 3;
y += 3;
w -= 6;
h -= 6;
}
float fontSize = h / 2;
nvgLinearGradient(vg, x, y, x, y + h, rgba(255, 255, 255, isBlack(color) ? 16 : 32, colorB),
rgba(0, 0, 0, isBlack(color) ? 16 : 32, colorC), bg);
nvgBeginPath(vg);
nvgRoundedRect(vg, x + 1, y + 1, w - 2, h - 2, cornerRadius - 1);
if (!isBlack(color)) {
nvgFillColor(vg, color);
nvgFill(vg);
}
nvgFillPaint(vg, bg);
nvgFill(vg);
nvgBeginPath(vg);
nvgRoundedRect(vg, x + 0.5f, y + 0.5f, w - 1, h - 1, cornerRadius - 0.5f);
nvgStrokeColor(vg, rgba(0, 0, 0, 48, colorA));
nvgStroke(vg);
ByteBuffer textEncoded = memEncodeASCII(text, BufferAllocator.MALLOC);
nvgFontSize(vg, fontSize);
nvgFontFace(vg, font);
tw = nvgTextBounds(vg, 0, 0, textEncoded, NULL, (ByteBuffer) null);
if (preicon != null) {
nvgFontSize(vg, h * 1.3f);
nvgFontFace(vg, "icons");
iw = nvgTextBounds(vg, 0, 0, preicon, NULL, (ByteBuffer) null);
iw += h * 0.15f;
}
if (preicon != null) {
nvgFontSize(vg, h * 1.3f);
nvgFontFace(vg, "icons");
nvgFillColor(vg, rgba(255, 255, 255, 96, colorA));
nvgTextAlign(vg, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE);
nvgText(vg, x + w * 0.5f - tw * 0.5f - iw * 0.75f, y + h * 0.5f, preicon, NULL);
}
nvgFontSize(vg, fontSize);
nvgFontFace(vg, font);
nvgTextAlign(vg, NVG_ALIGN_LEFT | NVG_ALIGN_MIDDLE);
nvgFillColor(vg, rgba(0, 0, 0, 160, colorA));
nvgText(vg, x + w * 0.5f - tw * 0.5f + iw * 0.25f, y + h * 0.5f - 1, textEncoded, NULL);
nvgFillColor(vg, rgba(255, 255, 255, 160, colorA));
nvgText(vg, x + w * 0.5f - tw * 0.5f + iw * 0.25f, y + h * 0.5f, textEncoded, NULL);
memFree(textEncoded);
}