Refactor NanoVGGUI - prepare to support NVGPaint and images

This commit is contained in:
2021-03-14 13:24:33 +01:00
parent 79286bbf53
commit 47cb04c9d1
3 changed files with 27 additions and 6 deletions

View File

@@ -67,11 +67,15 @@ public interface GUI extends Renderable, Disposable, KeyEventHandler {
void setGlobalAlpha(float alpha);
void fillColor(float red, float green, float blue, float alpha);
void setFillColor(float red, float green, float blue, float alpha);
void fill();
void setStrokeColor(float red, float green, float blue, float alpha);
void setStrokeWidth(float width);
void strokeColor(float red, float green, float blue, float alpha);
void stroke();
void clip(float x, float y, float width, float height);
}

View File

@@ -144,7 +144,8 @@ public class Label extends BaseComponent {
gui.setFontFace(font);
gui.setTextAlignment(alignment);
gui.setFontSize(fontSize);
gui.fillColor(red, green, blue, alpha);
gui.setFillColor(red, green, blue, alpha);
gui.fill();
gui.putTextBox(x + paddingLeft, y + paddingTop, getWidth() - paddingLeft - paddingRight, text, bounds);
}
}