Solved [REQUEST] --> Centering Text Utility Skript!

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

trixzymc

New Member
Dec 27, 2024
5
0
1
I'm having a difficult time creating this on my own.​
1735312575972.png

I want it to some what look like this, yet the free thing this is, is in java. I need a skript.​
 
No need to jump to the other category, I can help you with this, the steps can be tedious but it's very simple if you know how to do it:
1. Install skript reflect
2. Import the Minecraft map font class
3. Make a function that takes a list of strings and returns a list of strings, this will be the centering function.
4. In the function loop each string and get the pixel width, remember that between each character is a gap of one pixel.
5. Get the one with the greatest pixel width and by using spaces and the bold tag (this is very important as it can give strings a bit more width), loop the lines again and add `greastest pixel width - loop-string)/2` pixels worth of spaces at the beginning and end of each string (you don't necessarily need to do the end but you can if you want to be safe), and boom, you have it.

Note: the Minecraft map font doesn't account for all characters, foreign ones must be hardcoded, unfortunately.
 
No need to jump to the other category, I can help you with this, the steps can be tedious but it's very simple if you know how to do it:
1. Install skript reflect
2. Import the Minecraft map font class
3. Make a function that takes a list of strings and returns a list of strings, this will be the centering function.
4. In the function loop each string and get the pixel width, remember that between each character is a gap of one pixel.
5. Get the one with the greatest pixel width and by using spaces and the bold tag (this is very important as it can give strings a bit more width), loop the lines again and add `greastest pixel width - loop-string)/2` pixels worth of spaces at the beginning and end of each string (you don't necessarily need to do the end but you can if you want to be safe), and boom, you have it.

Note: the Minecraft map font doesn't account for all characters, foreign ones must be hardcoded, unfortunately.
Hello! I do not know any java, so I don't really know how to do this. I do got skript reflect.
 
This can be done with Skript reflect, if you need specific guidance go in skunity's discord server and into the reflect channel