diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index 071e0e8..e479558 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,13 +1,13 @@ arguments= auto.sync=false build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.6)) +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home=C\:/Program Files/Java/jdk-21 +java.home= jvm.arguments= offline.mode=false -override.workspace.settings=true +override.workspace.settings=false show.console.view=false show.executions.view=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 054f1e2..f614037 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ # -#Mon May 27 01:35:03 IDT 2024 +#Thu Jul 04 12:58:14 IDT 2024 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 diff --git a/build.gradle b/build.gradle index 9a39e77..4d00f20 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6.5' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'maven-publish' } @@ -47,12 +47,12 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - provided group: 'com.caoccao.javet', name: 'javet', version: '3.1.0' + provided group: 'com.caoccao.javet', name: 'javet', version: '3.1.3' // https://mvnrepository.com/artifact/com.github.oshi/oshi-core //provided group: 'com.github.oshi', name: 'oshi-core', version: '6.5.0' - modImplementation("com.terraformersmc:modmenu:10.0.0-beta.1") - modImplementation("me.shedaniel.cloth:cloth-config-fabric:14.0.126") + modImplementation("com.terraformersmc:modmenu:11.0.1") + modImplementation("me.shedaniel.cloth:cloth-config-fabric:15.0.127") //modApi("me.shedaniel.cloth:cloth-config-fabric:14.0.126") { // exclude(group: "net.fabricmc.fabric-api") //} @@ -67,7 +67,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - it.options.release = 17 + it.options.release = 21 } java { @@ -91,7 +91,8 @@ jar { // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name from components.java } } @@ -103,4 +104,4 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index ef94ea2..fd63604 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.20.6 -yarn_mappings=1.20.6+build.1 +minecraft_version=1.21 +yarn_mappings=1.21+build.7 loader_version=0.15.11 # Mod Properties -mod_version=3.2.0 -maven_group=io.github.ngspace.hudder +mod_version=3.3.0 +maven_group=hudder archives_base_name=hudder # Dependencies -fabric_version=0.97.8+1.20.6 \ No newline at end of file +fabric_version=0.100.4+1.21 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..b740cf1 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index 25da30d..7101f8e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/Hudder_client.launch b/hudder_client.launch similarity index 80% rename from Hudder_client.launch rename to hudder_client.launch index 8425cf4..ef0209e 100644 --- a/Hudder_client.launch +++ b/hudder_client.launch @@ -1,7 +1,7 @@ - + @@ -13,8 +13,8 @@ - - - + + + diff --git a/Hudder_server.launch b/hudder_server.launch similarity index 80% rename from Hudder_server.launch rename to hudder_server.launch index 8d3be5e..8daf40b 100644 --- a/Hudder_server.launch +++ b/hudder_server.launch @@ -1,7 +1,7 @@ - + @@ -13,8 +13,8 @@ - - - + + + diff --git a/logs/latest.log b/logs/latest.log deleted file mode 100644 index e69de29..0000000 diff --git a/settings.gradle b/settings.gradle index 75c4d72..dfacbd1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,4 +7,4 @@ pluginManagement { mavenCentral() gradlePluginPortal() } -} \ No newline at end of file +} diff --git a/src/main/java/io/github/ngspace/hudder/Hudder.java b/src/main/java/io/github/ngspace/hudder/Hudder.java index 9e82673..fbecbc6 100644 --- a/src/main/java/io/github/ngspace/hudder/Hudder.java +++ b/src/main/java/io/github/ngspace/hudder/Hudder.java @@ -13,7 +13,6 @@ import org.apache.commons.io.FileUtils; import org.jetbrains.annotations.Nullable; -import org.joml.Matrix4f; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,22 +24,13 @@ import io.github.ngspace.hudder.config.ConfigInfo; import io.github.ngspace.hudder.config.ConfigManager; import io.github.ngspace.hudder.data_management.Advanced; -import io.github.ngspace.hudder.meta.elements.Element; import io.github.ngspace.hudder.util.HudFileUtils; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferRenderer; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.render.Tessellator; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.render.RenderTickCounter; import net.minecraft.client.toast.SystemToast; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.logging.LoggerPrintStream; @@ -66,6 +56,8 @@ public class Hudder implements ModInitializer { public static MinecraftClient ins = null; public static final String ASSETS = "/assets/"+MOD_ID+"/"; + public static HudderRenderer renderer = new HudderRenderer(); + /** * Errors usually happen beyond this point * @throws Exception Because I fuck up a lot. @@ -75,7 +67,8 @@ public class Hudder implements ModInitializer { ConfigManager.setConfig(config); - if (!IS_DEBUG) IS_DEBUG = config.debug;//Should automatically turn on IS_DEBUG if there is an error reading config + //Should automatically turn on IS_DEBUG if there is an error reading config + if (!IS_DEBUG) IS_DEBUG = config.debug; Hudder.log("DEBUG MODE IS SET TO:" + IS_DEBUG); @@ -143,7 +136,7 @@ public class Hudder implements ModInitializer { } }); - ClientTickEvents.END_CLIENT_TICK.register(client -> {if (config.limitrate) compile(3f);}); + ClientTickEvents.END_CLIENT_TICK.register(client -> {if (config.limitrate) compile(null);}); HudRenderCallback.EVENT.register((context,delta) -> { if (!config.limitrate) compile(delta); @@ -151,17 +144,24 @@ public class Hudder implements ModInitializer { RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); try { - if (result!=null) drawCompileResult(context, ins.textRenderer, result, config, delta ); - else renderFail(context, LastFailMessage); - } catch (Exception e) {renderFail(context, e.getLocalizedMessage());} + if (result!=null) renderer.drawCompileResult(context, ins.textRenderer, result, config, + delta); + else renderer.renderFail(context, LastFailMessage); + } catch (Exception e) {renderer.renderFail(context, e.getLocalizedMessage());} RenderSystem.disableBlend(); } }); log(MOD_ID+" has been loaded!"); } - public void compile(float f) { + + public static void showToast(MinecraftClient CLIENT, Text title, Text content) { + CLIENT.getToastManager().add(new SystemToast(SystemToast.Type.PERIODIC_NOTIFICATION,title,content)); + } + public void showToast(MinecraftClient CLIENT, Text title) {showToast(CLIENT, title, Text.of(""));} + + public void compile(RenderTickCounter f) { try { - Advanced.delta = f; + Advanced.delta = f!=null?f.getLastFrameDuration():3; if (config.shouldCompile(ins)) { for (Consumer con : precomplistners) con.accept(config.compiler); result = config.compile(HudFileUtils.getFile(config.mainfile)); @@ -176,114 +176,12 @@ public void compile(float f) { if (IS_DEBUG) e.printStackTrace(); } } - public static void renderFail(DrawContext context, String FailMessage) { - String[] lines = FailMessage.split(NL_REGEX); - int y = 1; - for (String line : lines) { - renderText(context, line, 1, y, 0xFF5555, 1, false, true, 0xd6d6d6); - y+=9; - } - } - public static void showToast(MinecraftClient CLIENT, Text title, Text content) { - CLIENT.getToastManager().add(new SystemToast(SystemToast.Type.PERIODIC_NOTIFICATION,title,content)); - } - public void showToast(MinecraftClient CLIENT, Text title) {showToast(CLIENT, title, Text.of(""));} - - public void drawCompileResult(DrawContext context, TextRenderer renderer, CompileResult text, ConfigInfo info, - float delta) { - int color = info.color; - int bgcolor = info.backgroundcolor; - boolean shadow = info.shadow; - boolean background = info.background; - - //This is too complicated, imma replace it with TextElements ~~eventually~~ soon. - - /* Top Left */ - String[] lines = text.TopLeftText.split(NL_REGEX); - int yoff = info.yoffset; - int xoff = info.xoffset; - for (String txt : lines) { - renderText(context, txt, xoff, yoff, color, text.TLScale, shadow, background, bgcolor); - yoff+=info.lineHeight * text.TLScale; - } - - /* Bottom Left */ - String[] BL = text.BottomLeftText.split(NL_REGEX); - yoff = (int) (context.getScaledWindowHeight() - countLines(text.BottomLeftText) * - info.lineHeight * text.BLScale - info.yoffset + 1); - xoff = info.xoffset; - for (String txt : BL) { - renderText(context, txt, xoff, yoff, color, text.BLScale, shadow, background, bgcolor); - yoff+=info.lineHeight * text.BLScale; - } - - /* Top Right */ - String[] TR = text.TopRightText.split(NL_REGEX); - yoff = info.yoffset; -// xoff = 300 - info.xoffset; - for (String txt : TR) { - xoff = (int) (context.getScaledWindowWidth() - renderer.getWidth(txt) * text.TRScale - info.xoffset); - renderText(context, txt, xoff, yoff, color, text.TRScale, shadow, background, bgcolor); - yoff+=info.lineHeight * text.TRScale; - } - - /* Bottom Right */ - String[] BR = text.BottomRightText.split(NL_REGEX); - yoff = (int) (context.getScaledWindowHeight() - countLines(text.BottomRightText) * - info.lineHeight * text.BRScale - info.yoffset + 1); -// xoff = 300 - info.xoffset; - for (String txt : BR) { - xoff = (int) (context.getScaledWindowWidth() - renderer.getWidth(txt) * text.BRScale - info.xoffset); - renderText(context, txt, xoff, yoff, color, text.BRScale, shadow, background, bgcolor); - yoff+=info.lineHeight * text.BRScale; - } - - for (Element e : text.elements) e.renderElement(context,delta); - } - public int countLines(String what) { - int count = 1; - for (int i = 0; i consumer) {precomplistners.add(consumer);} public static void addPostCompilerListener(Consumer consumer) {postcomplistners.add(consumer);} - public static void log(Object str) {LOGGER.info(String.valueOf(str));} - public static void warn(Object str) {LOGGER.warn(String.valueOf(str));} + public static void log (Object str) {LOGGER.info (String.valueOf(str));} + public static void warn (Object str) {LOGGER.warn (String.valueOf(str));} public static void error(Object str) {LOGGER.error(String.valueOf(str));} public static void debug(Object str) {LOGGER.debug(String.valueOf(str));} public static void alert(Object str) {ins.player.sendMessage(Text.of(String.valueOf(str)));} diff --git a/src/main/java/io/github/ngspace/hudder/HudderRenderer.java b/src/main/java/io/github/ngspace/hudder/HudderRenderer.java new file mode 100644 index 0000000..567b642 --- /dev/null +++ b/src/main/java/io/github/ngspace/hudder/HudderRenderer.java @@ -0,0 +1,125 @@ +package io.github.ngspace.hudder; + +import org.joml.Matrix4f; + +import com.mojang.blaze3d.systems.RenderSystem; + +import io.github.ngspace.hudder.compilers.CompileResult; +import io.github.ngspace.hudder.config.ConfigInfo; +import io.github.ngspace.hudder.meta.elements.Element; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.RenderTickCounter; +import net.minecraft.client.render.Tessellator; +import net.minecraft.client.render.VertexFormat; +import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.util.math.MatrixStack; + +/** + * Hudder.java was too messy so I moved all rendering functions into this one class + */ +public class HudderRenderer { + public static final String NL_REGEX = "\r?\n"; + public void renderFail(DrawContext context, String FailMessage) { + String[] lines = FailMessage.split(NL_REGEX); + int y = 1; + for (String line : lines) { + renderTextLine(context, line, 1, y, 0xFF5555, 1, false, true, 0xd6d6d6); + y+=9; + } + } + + public void drawCompileResult(DrawContext context, TextRenderer renderer, CompileResult text, ConfigInfo info, + RenderTickCounter delta) { + int color = info.color; + int bgcolor = info.backgroundcolor; + boolean shadow = info.shadow; + boolean background = info.background; + + //This is too complicated, imma replace it with TextElements ~~eventually~~ soon. + + /* Top Left */ + String[] lines = text.TopLeftText.split(NL_REGEX); + int yoff = info.yoffset; + int xoff = info.xoffset; + for (String txt : lines) { + renderTextLine(context, txt, xoff, yoff, color, text.TLScale, shadow, background, bgcolor); + yoff+=info.lineHeight * text.TLScale; + } + + /* Bottom Left */ + String[] BL = text.BottomLeftText.split(NL_REGEX); + yoff = (int) (context.getScaledWindowHeight() - countLines(text.BottomLeftText) * + info.lineHeight * text.BLScale - info.yoffset + 1); + xoff = info.xoffset; + for (String txt : BL) { + renderTextLine(context, txt, xoff, yoff, color, text.BLScale, shadow, background, bgcolor); + yoff+=info.lineHeight * text.BLScale; + } + + /* Top Right */ + String[] TR = text.TopRightText.split(NL_REGEX); + yoff = info.yoffset; +// xoff = 300 - info.xoffset; + for (String txt : TR) { + xoff = (int) (context.getScaledWindowWidth() - renderer.getWidth(txt) * text.TRScale - info.xoffset); + renderTextLine(context, txt, xoff, yoff, color, text.TRScale, shadow, background, bgcolor); + yoff+=info.lineHeight * text.TRScale; + } + + /* Bottom Right */ + String[] BR = text.BottomRightText.split(NL_REGEX); + yoff = (int) (context.getScaledWindowHeight() - countLines(text.BottomRightText) * + info.lineHeight * text.BRScale - info.yoffset + 1); +// xoff = 300 - info.xoffset; + for (String txt : BR) { + xoff = (int) (context.getScaledWindowWidth() - renderer.getWidth(txt) * text.BRScale - info.xoffset); + renderTextLine(context, txt, xoff, yoff, color, text.BRScale, shadow, background, bgcolor); + yoff+=info.lineHeight * text.BRScale; + } + + for (Element e : text.elements) e.renderElement(context,delta); + } + public int countLines(String what) { + int count = 1; + for (int i = 0; i