diff options
Diffstat (limited to 'src/main/kotlin/cc/polyfrost')
-rw-r--r-- | src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt | 36 |
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) |