-
Notifications
You must be signed in to change notification settings - Fork 1
Writting Text
text rendering is complex under the hood, but ive tried my best to make it as similar to vanilla Minecraft as possible
Note
Emojis do not work on GNUI at the moment. sorry for the inconvinience
because emojis are automatically done by Figura, the GNUI text system has no way of cooperating with that unless an API is made that processes strings into emojis in figura.
GNUI preprocesses raw json texts to allow word wrapping / clipping.
you can simply just slap a normal string into the method. or if you want to pass in a raw json, it has to be a table:
Box.setText({text="Hello World \n I am alive",color="yellow"})
and any type of data can be passed in as text, it will get converted into a string.
Text in GNUI can be aligned to any parts of the box. you can imagine it like Box.Anchor but for texts.
Box:setTextAlign(x,y)

you can also shift the text using Box:setTextOffset(x,y)
by default, GNUI just renders the text regardles of size. but you can tell it what to do when the text is out of bounds.
the behavior can be one of the following:

Figura has built in text styles you can use along side text tasks, GNUI allows you to use them.
in case you dont know what they look like, here is an example of each effect
