Shift Text
Last updated
Last updated
shift-text provides vertical offset for text. The default configuration applies a slight downward shift to better align the text with the background positioning. This ensures that the text is displayed in harmony with other visual elements, such as nameplates or bubbles, improving overall aesthetic consistency.
Fonts are registered within the config.yml
file. Here are a few examples to demonstrate how this system works:
Using shift_1 as an example, if the ascii
font has a height of 8 pixels (font image height) and an ascent of 3, it means the text is shifted downward by 5 pixels relative to its normal position. This downward offset is calculated as the difference between the height and ascent (8 - 3 = 5
), meaning the text will appear lower than usual to align with other elements.
Here’s an example of the default height configuration for fonts in config.yml
:
For the accented font, due to its larger height, a higher ascent value is used to maintain proper alignment. In this case, an ascent of 6 is applied instead of 3, balancing the larger font height for accented characters.
By adjusting the values in the configuration, you'll notice a clear visual difference in how the text is rendered. Here’s an example of how these adjustments might look: (Please note that after making these adjustments, you'll need to reload your resource pack for the changes to take effect! This ensures that all the new font settings, such as the updated heights and ascents, are properly applied and reflected in-game.)
When using this in practice, you only need to select the specific character sets you plan to use and create offset fonts accordingly. This approach minimizes the size of the resource pack by avoiding the inclusion of unnecessary character sets, leading to better performance and faster loading times.
In the default configuration, since only numbers are used for displaying gold, money
uses shift_2
and selected the ASCII character set. This efficiently minimizes the resource pack by only including the necessary characters for the money display.