Skip to content

An simple core shader allows you make multiple layer text component.

License

Notifications You must be signed in to change notification settings

toxicity188/mult-layer-display-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

녹화_2024_05_03_10_03_28_717-min
Normal core shader, occurring z-fighting problem. 녹화_2024_05_03_10_05_19_637-min (1)
My shader. no z-fighting!

How to use?

{"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.

{"type":"bitmap","file":"betterhealthbar:splitter.png","ascent":-9999,"height":-2,"chars":["򠀀"]}

Then, merge your image by space font.

{"type":"space","advances":{"򮀀":-8192,"򮀁":-8191,"򮀂":-8190,"򮀃":-8189,"򮀄":-8188,"򮀅":-8187}}

Don't forget to use spliitter!

        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!

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

Result

녹화_2024_05_05_01_48_15_383-min
Enjoy your multi line text display!

Releases

No releases published

Packages

No packages published

Languages