-
Notifications
You must be signed in to change notification settings - Fork 17
GUI Properties
The name of a GUI is the title that was provided during its creation. It can be set, cleared, or reset. You can simply use Skript's 'name' expression to obtain this:
the name of the guiNote
If you create a GUI using syntax not provided by skript-gui, this value may not be available or accurate.
The size of a GUI is the number of slots it has. It can be set or reset. You can simply use Skript's 'size' expression to obtain this:
the size of the guiskript-gui supports defining custom layouts for your GUI that makes defining many slots at once a breeze. The layout of a GUI can be specified during its creation:
create a gui with virtual chest inventory with 3 rows named "Layout GUI" and layout "xxxxxxxxx", "x-------x", and "xxxxxxxxx"The important part of the syntax here is and layout, with the full pattern being: [(and|with) (layout|shape) %-texts%]. This goes at the end of the create a gui statement.
The layout of a GUI is comprised of texts, where each text represents a row in the inventory, and each character in the text represents a slot. By assigning the same character to multiple slots, those slots will share the same items and behavior when formatted.
So, we can format a specific part of the layout by specifying its identifying character as the slot:
create a gui with virtual chest inventory with 3 rows named "Layout GUI" and layout "xxxxxxxxx", "x-------x", and "xxxxxxxxx":
make gui slot "x" with gold ingot named "<gold>Treasure"
open last gui to playerIn-game, we can view the result:
The layout of a GUI can also be obtained or change using the gui layout expression:
[gui] (layout|shape)[s] of %guis%
%guis%'[s] [gui] (layout|shape)[s]For example, we could edit the GUI to invert the shape when the treasure is clicked:
create a gui with virtual chest inventory with 3 rows named "Layout GUI" and layout "xxxxxxxxx", "x-------x", and "xxxxxxxxx":
make gui slot "x" with gold ingot named "<gold>Treasure":
set the gui's layout to "---------", "-xxxxxxx-", and "---------"
open last gui to playerCaution
Coming Soon