https://github.com/toxicity188/mult-layer-display-text
An simple core shader allows you make multiple layer text component.
https://github.com/toxicity188/mult-layer-display-text
core-shader glsl glsl-shaders minecraft mod paper paper-plugin plugin spigot spigot-plugin util
Last synced: about 1 year ago
JSON representation
An simple core shader allows you make multiple layer text component.
- Host: GitHub
- URL: https://github.com/toxicity188/mult-layer-display-text
- Owner: toxicity188
- License: mit
- Created: 2024-05-04T16:41:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-04T17:04:00.000Z (about 2 years ago)
- Last Synced: 2025-04-01T19:48:40.483Z (about 1 year ago)
- Topics: core-shader, glsl, glsl-shaders, minecraft, mod, paper, paper-plugin, plugin, spigot, spigot-plugin, util
- Language: GLSL
- Homepage:
- Size: 9.77 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multi line display text
An simple core shader allows you make multiple layer text component.
# How this core shader can help you?
There's some issues in minecraft font and text display component.
- Text's ascent value cannot be more than it's height.
- If two different images overlapped, z-fighting problem is occurred.
But, this core shader removes all of this problem!
# Comparison

Normal core shader, occurring z-fighting problem.

My shader. no z-fighting!
# How to use?
``` json
{"type":"bitmap","file":"betterhealthbar:default_layout/image/1/empty_empty.png","ascent":-8192,"height":4,"chars":[""]}
```
First, you should minuse **-8192** to your font ascent.
``` json
{"type":"bitmap","file":"betterhealthbar:splitter.png","ascent":-9999,"height":-2,"chars":[""]}
```
Then, merge your image by space font.
``` json
{"type":"space","advances":{"":-8192,"":-8191,"":-8190,"":-8189,"":-8188,"":-8187}}
```
Don't forget to use spliitter!
``` kotlin
val display = TextDisplay(EntityType.TEXT_DISPLAY, (player.world as CraftWorld).handle).apply {
billboardConstraints = Display.BillboardConstraints.CENTER //Must!!!!!!!
entityData.run {
set(Display.DATA_POS_ROT_INTERPOLATION_DURATION_ID, 1)
set(TextDisplay.DATA_BACKGROUND_COLOR_ID, 0)
set(TextDisplay.DATA_LINE_WIDTH_ID, Int.MAX_VALUE)
}
brightnessOverride = Brightness(15, 15)
text = PaperAdventure.asVanilla(component)
}
```
And, you can use display or amor stand. but don't forget to set the billboard of display to CENTER!

Now, you have to modify image's alpha value to 1~254 (the greater, the higher layer.)
# Result

Enjoy your multi line text display!