Modding:GUIs: Difference between revisions
From Vintage Story Wiki
Line 91: | Line 91: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
This covers some of the most basic parts. There is a grand amount of various pre-built UI elements that each come with their own argument list that are in dire need of Documentation. Here's an overview of some of the more commonly used ones | |||
===Dialog / Graphics=== | |||
* <code>.AddShadedDialogBG</code>: Draws a pretty background and dialog border | |||
* <code>.AddDialogTitleBar</code>: Draws a title bar with a close button and a button to move around the dialog | |||
* <code>.AddInset</code>: Adds a darkened section with a inset border around it | |||
====Text==== | |||
* <code>.AddStaticText</code>: Add a static snippet of text | |||
* <code>.AddDynamicText</code>: Add a static snippet of text that can be set to other texts without the need to redraw the whole dialog | |||
* <code>.AddRichtext</code>: Same as <code>.AddDynamicText</code> but allows use of [[VTML]] - a minimalist version of HTML code | |||
* <code>.AddHoverText</code>: When the mouse cursor moves over the element boundaries, will show supplied text as a tooltip | |||
====UI Control/Input=== | |||
* <code>.AddButton</code>: Adds a clickable button | |||
* <code>.AddDropDown</code>: Adds a drop down element | |||
* <code>.AddHorizontalTabs</code>: Adds horizontally aligned tabs, like the ingame chat window has | |||
* <code>.AddVerticalScrollbar</code>: Adds a vertical scrollbar | |||
* <code>.AddTextInput</code>: Adds an single line editable text field | |||
* <code>.AddNumberInput</code>: Adds an editable text field built for entering numbers | |||
* <code>.AddTextArea</code>: Adds multiple line editable text field | |||
====Other==== | |||
* <code>.AddIf</code>/<code>.EndIf</code>: Can be used to conditionally add certain elements (but you can also just split up your creation code for more fine grained control) | |||
* <code>.BeginClip</code>/<code>.EndClip</code>: Used in combination with a scrollbar to cut away oversized content, such as in the creative inventory | |||
* <code>.AddStaticCustomDraw</code>: Lets you define your own drawing code to be added to the GUI | |||
== Examples == | == Examples == |