Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
library:inventorygui:usage [2021/05/11 11:36] – [Dynamic Element] Add per player info phoenix616 | library:inventorygui:usage [2025/04/18 12:45] (current) – [Creating the GUI] phoenix616 | ||
---|---|---|---|
Line 18: | Line 18: | ||
The GUI supports 3\*3, 5\*1 and 9\*x inventory sizes. | The GUI supports 3\*3, 5\*1 and 9\*x inventory sizes. | ||
Sizes that do not match these are getting expanded to the next bigger one. | Sizes that do not match these are getting expanded to the next bigger one. | ||
- | |||
## Creating the GUI | ## Creating the GUI | ||
You create GUIs assigned to an InventoryHolder like a Container or a LivingEntity. | You create GUIs assigned to an InventoryHolder like a Container or a LivingEntity. | ||
Line 28: | Line 27: | ||
gui.setFiller(new ItemStack(Material.GRAY_STAINED_GLASS, | gui.setFiller(new ItemStack(Material.GRAY_STAINED_GLASS, | ||
``` | ``` | ||
+ | |||
+ | If you want to use more advanced formatting of text with RGB colors then take a look at [[library: | ||
## Adding to the GUI | ## Adding to the GUI | ||
Line 116: | Line 117: | ||
You can also set the state directly via `GuiStateElement# | You can also set the state directly via `GuiStateElement# | ||
before you show the GUI or re-draw it. | before you show the GUI or re-draw it. | ||
- | |||
### Dynamic Element | ### Dynamic Element | ||
You can also dynamically load elements each time the GUI is re-drawn and for each viewing player individually. E.g. when you want to cache GUIs but not the text of some buttons, display different elements per player or dynamically change them while they are open without closing and reopening them. | You can also dynamically load elements each time the GUI is re-drawn and for each viewing player individually. E.g. when you want to cache GUIs but not the text of some buttons, display different elements per player or dynamically change them while they are open without closing and reopening them. | ||
Line 133: | Line 133: | ||
})); | })); | ||
``` | ``` | ||
- | As you can see you can change the content of a DynamicGuiElement after a player | + | As you can see you can change the content of a DynamicGuiElement after a player |
### Element Group | ### Element Group |