-
Notifications
You must be signed in to change notification settings - Fork 1
Overlay
The link.getOverlay() will give you a table full of the functions listed down below.
All "Keys" are for updating the element later so you dont need to clear the element every time.
Do note that the x and y aren't exactly related to your resolution, so x=1920 y=1080 will not put it in the corner, it will put it like much much further outside of the screen. It does change depending on your resolution though.
For text, the max is
3440x1440 - 852x352
1920x1080 - 472x262
For Rectangle:
3440x1440 - 860x360
1920x1080 - 480x270
For Item:
3440x1440 - 844x344
1920x1080 - 464x254
these are all for fullscreen.
this WILL be different for yours if you have a different resolution.
NOTE: After the v4 update, im not sure if the resolutions are still correct, since i rewrote the entire system.
Adds text on the screen, you can also scale it.
ex: addOrUpdateTextElement("simpletext","hello!",1,1,0xFF0000,1)
Removes the text element related to the key.
addOrUpdateRightboundTextElement(String key, String newText, int newX, int newY, int newColor, float scale)
Same as the normal text, just rightbound. Adds a rightbound text on the screen, you can also scale it.
ex: addOrUpdateTextElement("simplerighttext","hello! but right",1,1,0x00FF00,1)
This will remove the rightbound text element related to the key.
Adds a rectangle element, transparency is 0 to 100, above 10 its hard to see a difference but its there.
ex: addOrUpdateRectElement("testsquare",1,1,50,50,0xFFFFFF,1)
Removes a rectangle element related to the key.
Adds a item display to your screen.
ex: addOrUpdateItemElement("dirt","minecraft:dirt",1,1)
Removes a item element related to the key.
Clears all text elements.
Clears all rightbound text elements.
Clears all rectangle elements.
Clears all item elements
Clears every element, canvas reset.
Sends the packet to update your hud, this is needed everytime you want to update your hud.
I will update the wiki if some of the examples aren't correct.