diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-28 12:02:04 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-28 12:02:04 +0700 |
commit | 01e4c0dfb2a9726a9bf1c4d1a1fe28edbc3d094c (patch) | |
tree | 2949a7d1a9e6a5e9fbf6db983491ab813614b889 /src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java | |
parent | 2f45fed981d7fcdf6e39791fecfa1dd410614fbf (diff) | |
download | OneConfig-01e4c0dfb2a9726a9bf1c4d1a1fe28edbc3d094c.tar.gz OneConfig-01e4c0dfb2a9726a9bf1c4d1a1fe28edbc3d094c.tar.bz2 OneConfig-01e4c0dfb2a9726a9bf1c4d1a1fe28edbc3d094c.zip |
OC-32 OC-34 (#24)
* OC-34 hypixel utils class (#21)
* OC-26 Build Workflow
* OC-26 oops
* OC-33 some networking utils
* OC-34 idk
* OC-34 idk
* OC-34 restructure hypixel utils
* hypixelutils and multithreading
implement more events
remove vcal icon stuff
* more javadocs
Co-authored-by: Ethan <git@ethanlibs.co>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java index 252a588..f9f0fbd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java @@ -5,7 +5,20 @@ import cc.polyfrost.oneconfig.lwjgl.font.Fonts; import java.util.ArrayList; +/** + * Simple text utility class for NanoVG text rendering. + */ public final class TextUtils { + + /** + * Wraps a string into an array of lines. + * @param vg The NanoVG context. + * @param text The text to wrap. + * @param maxWidth The maximum width of each line. + * @param fontSize The font size. + * @param font The font to use. + * @return The array of lines. + */ public static ArrayList<String> wrapText(long vg, String text, float maxWidth, float fontSize, Fonts font) { ArrayList<String> wrappedText = new ArrayList<>(); text += " "; |