aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/polyfrost
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-08-24 22:51:58 +0200
committerGitHub <noreply@github.com>2022-08-24 22:51:58 +0200
commitdaed9569a0f1d2231c4f824f6cffd72d5f8ae8bd (patch)
tree6efee702c616d96e40a3e69ce89425f0936a7598 /src/main/kotlin/cc/polyfrost
parenta76b49be6dbeb0be3f88870e33d3e10e0e7f8e1c (diff)
downloadOneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.tar.gz
OneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.tar.bz2
OneConfig-daed9569a0f1d2231c4f824f6cffd72d5f8ae8bd.zip
Notifs (#111)
* Start on notifications * Finish notifications (pog) * oop * internalizing * misc: set default duration to 4000ms * Scaling notifs stuff Co-authored-by: Wyvest <45589059+Wyvest@users.noreply.github.com>
Diffstat (limited to 'src/main/kotlin/cc/polyfrost')
-rw-r--r--src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt
index ac6ff9c..9015361 100644
--- a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt
+++ b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt
@@ -164,11 +164,11 @@ fun Long.drawText(text: String, x: Number, y: Number, color: Int, size: Number,
fun VG.drawText(text: String, x: Number, y: Number, color: Int, size: Number, font: Font) =
instance.drawText(text, x, y, color, size, font)
-fun Long.drawWrappedString(text: String, x: Number, y: Number, width: Number, color: Int, size: Number, font: Font) =
- RenderManager.drawWrappedString(this, text, x.toFloat(), y.toFloat(), width.toFloat(), color, size.toFloat(), font)
+fun Long.drawWrappedString(text: String, x: Number, y: Number, width: Number, color: Int, size: Number, lineHeight: Number, font: Font) =
+ RenderManager.drawWrappedString(this, text, x.toFloat(), y.toFloat(), width.toFloat(), color, size.toFloat(), lineHeight.toFloat(), font)
-fun VG.drawWrappedString(text: String, x: Number, y: Number, width: Number, color: Int, size: Number, font: Font) =
- instance.drawWrappedString(text, x, y, width, color, size, font)
+fun VG.drawWrappedString(text: String, x: Number, y: Number, width: Number, color: Int, size: Number, lineHeight: Number, font: Font) =
+ instance.drawWrappedString(text, x, y, width, color, size, lineHeight, font)
fun Long.drawURL(url: String, x: Number, y: Number, size: Number, font: Font, inputHandler: InputHandler) =
RenderManager.drawURL(this, url, x.toFloat(), y.toFloat(), size.toFloat(), font, inputHandler)
@@ -259,10 +259,20 @@ fun NVGColor.fill(r: Float, g: Float, b: Float, a: Float) = RenderManager.fillNV
fun Long.scale(x: Float, y: Float) = RenderManager.scale(this, x, y)
fun VG.scale(x: Float, y: Float) = instance.scale(x, y)
+fun Long.translate(x: Float, y: Float) = RenderManager.translate(this, x, y)
+fun VG.translate(x: Float, y: Float) = instance.translate(x, y)
+
+fun Long.resetTransform() = RenderManager.resetTransform(this)
+fun VG.resetTransform() = instance.resetTransform()
fun Long.setAlpha(alpha: Float) = RenderManager.setAlpha(this, alpha)
fun VG.setAlpha(alpha: Float) = instance.setAlpha(alpha)
+fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, scale: Number) =
+ RenderManager.drawSvg(this, filePath, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), scale.toFloat())
+
+fun VG.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, scale: Number) =
+ instance.drawSVG(filePath, x, y, width, height, scale)
fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number) =
RenderManager.drawSvg(this, filePath, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat())
@@ -270,18 +280,36 @@ fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height:
fun VG.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number) =
instance.drawSVG(filePath, x, y, width, height)
+fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int, scale: Number) =
+ RenderManager.drawSvg(this, filePath, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color, scale.toFloat())
+
+fun VG.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int, scale: Number) =
+ instance.drawSVG(filePath, x, y, width, height, color, scale.toFloat())
+
fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int) =
RenderManager.drawSvg(this, filePath, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color)
fun VG.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int) =
instance.drawSVG(filePath, x, y, width, height, color)
+fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, scale: Number) =
+ RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), scale.toFloat())
+
+fun VG.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, scale: Number) =
+ instance.drawSVG(svg, x, y, width, height, scale)
+
fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number) =
RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat())
fun VG.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number) =
instance.drawSVG(svg, x, y, width, height)
+fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, color: Int, scale: Number) =
+ RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color, scale.toFloat())
+
+fun VG.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, color: Int, scale: Number) =
+ instance.drawSVG(svg, x, y, width, height, color, scale)
+
fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, color: Int) =
RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color)