diff options
| author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-27 15:02:15 +0200 |
|---|---|---|
| committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-27 15:02:15 +0200 |
| commit | a93ec306e83f51e121441cb00f04cd9bb36d6951 (patch) | |
| tree | dfed34f8b89700276386ee941a76277e7ea26404 /src/main/java/io/polyfrost/oneconfig/lwjgl | |
| parent | 32e80596448ca536335638a63b1c7eccb8a12e95 (diff) | |
| download | OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.tar.gz OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.tar.bz2 OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.zip | |
Some more config refinements and some gui improvements
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/lwjgl')
| -rw-r--r-- | src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java index 87e3d03..e9bbf47 100644 --- a/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java +++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java @@ -193,6 +193,20 @@ public final class RenderManager { } } + public static void drawImage(long vg, String fileName, float x, float y, float width, float height, int color) { + if (ImageLoader.INSTANCE.loadImage(vg, fileName)) { + NVGPaint imagePaint = NVGPaint.calloc(); + Image image = ImageLoader.INSTANCE.getImage(fileName); + nvgBeginPath(vg); + nvgImagePattern(vg, x, y, width, height, 0, image.getReference(), 1, imagePaint); + nvgRGBA((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF), (byte) (color >> 24 & 0xFF), imagePaint.innerColor()); + nvgRect(vg, x, y, width, height); + nvgFillPaint(vg, imagePaint); + nvgFill(vg); + imagePaint.free(); + } + } + public static void drawSVGImage(long vg, String fileName, float x, float y, float width, float height) { if (ImageLoader.INSTANCE.loadSVGImage(fileName)) { try { |
