Class GuiComposerHelpers
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public static class GuiComposerHelpers
- Inheritance
-
GuiComposerHelpers
- Inherited Members
Methods
AddAutoSizeHoverText(GuiComposer, string, CairoFont, int, ElementBounds, string)
public static GuiComposer AddAutoSizeHoverText(this GuiComposer composer, string text, CairoFont font, int width, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringfont
CairoFontwidth
intbounds
ElementBoundskey
string
Returns
AddButton(GuiComposer, string, ActionConsumable, ElementBounds, CairoFont, EnumButtonStyle, string)
Adds a clickable button
public static GuiComposer AddButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, CairoFont buttonFont, EnumButtonStyle style = EnumButtonStyle.Normal, string key = null)
Parameters
composer
GuiComposertext
stringThe text displayed inside the button
onClick
ActionConsumableHandler for when the button is clicked
bounds
ElementBoundsbuttonFont
CairoFontThe font to be used for the text inside the button.
style
EnumButtonStylekey
string
Returns
AddButton(GuiComposer, string, ActionConsumable, ElementBounds, CairoFont, EnumButtonStyle, EnumTextOrientation, string)
[Obsolete("Use Method without orientation argument")]
public static GuiComposer AddButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, CairoFont buttonFont, EnumButtonStyle style, EnumTextOrientation orientation, string key = null)
Parameters
composer
GuiComposertext
stringonClick
ActionConsumablebounds
ElementBoundsbuttonFont
CairoFontstyle
EnumButtonStyleorientation
EnumTextOrientationkey
string
Returns
AddButton(GuiComposer, string, ActionConsumable, ElementBounds, EnumButtonStyle, string)
Adds a clickable button button with font CairoFont.ButtonText()
public static GuiComposer AddButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, EnumButtonStyle style = EnumButtonStyle.Normal, string key = null)
Parameters
composer
GuiComposertext
stringThe text displayed inside the button
onClick
ActionConsumableHandler for when the button is clicked
bounds
ElementBoundsstyle
EnumButtonStylekey
string
Returns
AddButton(GuiComposer, string, ActionConsumable, ElementBounds, EnumButtonStyle, EnumTextOrientation, string)
[Obsolete("Use Method without orientation argument")]
public static GuiComposer AddButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, EnumButtonStyle style, EnumTextOrientation orientation, string key = null)
Parameters
composer
GuiComposertext
stringonClick
ActionConsumablebounds
ElementBoundsstyle
EnumButtonStyleorientation
EnumTextOrientationkey
string
Returns
AddCellList<T>(GuiComposer, ElementBounds, OnRequireCell<T>, IEnumerable<T>, string)
Adds a List to the current GUI.
public static GuiComposer AddCellList<T>(this GuiComposer composer, ElementBounds bounds, OnRequireCell<T> cellCreator, IEnumerable<T> cells = null, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the cell.
cellCreator
OnRequireCell<T>the event fired when the cell is requested by the GUI
cells
IEnumerable<T>The cells of the list.
key
stringThe identifier for the list.
Returns
Type Parameters
T
AddChatInput(GuiComposer, ElementBounds, Action<string>, string)
Adds a chat input to the GUI.
public static GuiComposer AddChatInput(this GuiComposer composer, ElementBounds bounds, Action<string> onTextChanged, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the text.
onTextChanged
Action<string>The event fired when the text is changed.
key
stringThe name of this chat component.
Returns
AddColorListPicker(GuiComposer, int[], Action<int>, ElementBounds, int, string)
Adds a range of clickable colors
public static GuiComposer AddColorListPicker(this GuiComposer composer, int[] colors, Action<int> onToggle, ElementBounds startBounds, int maxLineWidth, string key = null)
Parameters
composer
GuiComposercolors
int[]onToggle
Action<int>startBounds
ElementBoundsmaxLineWidth
intkey
string
Returns
AddCompactVerticalScrollbar(GuiComposer, Action<float>, ElementBounds, string)
Adds a compact vertical scrollbar to the current GUI.
public static GuiComposer AddCompactVerticalScrollbar(this GuiComposer composer, Action<float> onNewScrollbarValue, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposeronNewScrollbarValue
Action<float>The event fired for the change in the scrollbar.
bounds
ElementBoundsthe bounds of the scrollbar.
key
stringthe internal name of the scrollbar.
Returns
AddConfigList(GuiComposer, List<ConfigItem>, ConfigItemClickDelegate, CairoFont, ElementBounds, string)
Adds a config List to the current GUI.
public static GuiComposer AddConfigList(this GuiComposer composer, List<ConfigItem> items, ConfigItemClickDelegate onItemClick, CairoFont font, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposeritems
List<ConfigItem>The items to add.
onItemClick
ConfigItemClickDelegateThe event fired when the item is clicked.
font
CairoFontThe font of the Config List.
bounds
ElementBoundsThe bounds of the config list.
key
stringThe name of the config list.
Returns
AddContainer(GuiComposer, ElementBounds, string)
Adds a container to the current GUI. Can be used to add any gui element within a scrollable window.
public static GuiComposer AddContainer(this GuiComposer composer, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the cell.
key
stringThe identifier for the list.
Returns
AddCustomRender(GuiComposer, ElementBounds, RenderDelegateWithBounds)
Adds a static custom draw component to the GUI.
public static GuiComposer AddCustomRender(this GuiComposer composer, ElementBounds bounds, RenderDelegateWithBounds onRender)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the component.
onRender
RenderDelegateWithBoundsThe event fired when the element is drawn.
Returns
AddDialogBG(GuiComposer, ElementBounds, bool, float)
public static GuiComposer AddDialogBG(this GuiComposer composer, ElementBounds bounds, bool withTitleBar = true, float alpha = 1)
Parameters
composer
GuiComposerbounds
ElementBoundswithTitleBar
boolalpha
float
Returns
AddDialogTitleBar(GuiComposer, string, Action, CairoFont, ElementBounds)
Adds a dialog title bar to the GUI.
public static GuiComposer AddDialogTitleBar(this GuiComposer composer, string text, Action onClose = null, CairoFont font = null, ElementBounds bounds = null)
Parameters
composer
GuiComposertext
stringThe text of the title bar.
onClose
ActionThe event fired when the title bar is closed.
font
CairoFontThe font of the title bar.
bounds
ElementBoundsThe bounds of the title bar.
Returns
AddDialogTitleBarWithBg(GuiComposer, string, Action, CairoFont, ElementBounds)
Adds a dialog title bar to the GUI with a background.
public static GuiComposer AddDialogTitleBarWithBg(this GuiComposer composer, string text, Action onClose = null, CairoFont font = null, ElementBounds bounds = null)
Parameters
composer
GuiComposertext
stringThe text of the title bar.
onClose
ActionThe event fired when the title bar is closed.
font
CairoFontThe font of the title bar.
bounds
ElementBoundsThe bounds of the title bar.
Returns
AddDropDown(GuiComposer, string[], string[], int, SelectionChangedDelegate, ElementBounds, string)
Adds a dropdown to the current GUI instance.
public static GuiComposer AddDropDown(this GuiComposer composer, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposervalues
string[]The values of the current drodown.
names
string[]The names of those values.
selectedIndex
intThe default selected index.
onSelectionChanged
SelectionChangedDelegateThe event fired when the index is changed.
bounds
ElementBoundsThe bounds of the index.
key
stringThe name of this dropdown.
Returns
AddDropDown(GuiComposer, string[], string[], int, SelectionChangedDelegate, ElementBounds, CairoFont, string)
Adds a dropdown to the current GUI instance.
public static GuiComposer AddDropDown(this GuiComposer composer, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, CairoFont font, string key = null)
Parameters
composer
GuiComposervalues
string[]The values of the current drodown.
names
string[]The names of those values.
selectedIndex
intThe default selected index.
onSelectionChanged
SelectionChangedDelegateThe event fired when the index is changed.
bounds
ElementBoundsThe bounds of the index.
font
CairoFontkey
stringThe name of this dropdown.
Returns
AddDynamicCustomDraw(GuiComposer, ElementBounds, DrawDelegateWithBounds, string)
Adds a dynamic custom draw component to the GUI.
public static GuiComposer AddDynamicCustomDraw(this GuiComposer composer, ElementBounds bounds, DrawDelegateWithBounds onDraw, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the component.
onDraw
DrawDelegateWithBoundsThe event fired when the element is drawn.
key
stringThe name of the element.
Returns
AddElementListPicker<T>(GuiComposer, Type, T[], Action<int>, ElementBounds, int, string)
Adds multiple buttons with Text.
public static GuiComposer AddElementListPicker<T>(this GuiComposer composer, Type pickertype, T[] elems, Action<int> onToggle, ElementBounds startBounds, int maxLineWidth, string key)
Parameters
composer
GuiComposerpickertype
Typeelems
T[]onToggle
Action<int>The event fired when the button is pressed.
startBounds
ElementBoundsThe bounds of the buttons.
maxLineWidth
intkey
stringThe key given to the bundle of buttons.
Returns
Type Parameters
T
AddEmbossedText(GuiComposer, string, CairoFont, ElementBounds, string)
Adds an embossed text component to the GUI.
public static GuiComposer AddEmbossedText(this GuiComposer composer, string text, CairoFont font, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the component.
font
CairoFontThe font of the text.
bounds
ElementBoundsThe bounds of the component.
key
stringThe name of the component.
Returns
AddHorizontalTabs(GuiComposer, GuiTab[], ElementBounds, Action<int>, CairoFont, CairoFont, string)
Adds a set of horizontal tabs to the GUI.
public static GuiComposer AddHorizontalTabs(this GuiComposer composer, GuiTab[] tabs, ElementBounds bounds, Action<int> onTabClicked, CairoFont font, CairoFont selectedFont, string key = null)
Parameters
composer
GuiComposertabs
GuiTab[]The collection of tabs.
bounds
ElementBoundsThe bounds of the horizontal tabs.
onTabClicked
Action<int>The event fired when the tab is clicked.
font
CairoFontThe font of the tabs.
selectedFont
CairoFontkey
stringThe key for the added horizontal tabs.
Returns
AddHoverText(GuiComposer, string, CairoFont, int, ElementBounds, string)
Adds a hover text to the GUI.
public static GuiComposer AddHoverText(this GuiComposer composer, string text, CairoFont font, int width, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text.
font
CairoFontThe font of the text.
width
intThe width of the text.
bounds
ElementBoundsThe bounds of the text.
key
stringThe name of this hover text component.
Returns
AddHoverText(GuiComposer, string, CairoFont, int, ElementBounds, TextBackground, string)
Adds a hover text to the GUI.
public static GuiComposer AddHoverText(this GuiComposer composer, string text, CairoFont font, int width, ElementBounds bounds, TextBackground background, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text.
font
CairoFontThe font of the text.
width
intThe width of the text.
bounds
ElementBoundsThe bounds of the text.
background
TextBackgroundkey
stringThe name of this hover text component.
Returns
AddIconButton(GuiComposer, string, Action<bool>, ElementBounds, string)
Adds an icon button.
public static GuiComposer AddIconButton(this GuiComposer composer, string icon, Action<bool> onToggle, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposericon
stringThe name of the icon.
onToggle
Action<bool>The event that happens once the button is toggled.
bounds
ElementBoundsThe bounding box of the button.
key
stringThe name of the button for easy access.
Returns
AddIconListPicker(GuiComposer, string[], Action<int>, ElementBounds, int, string)
Adds multiple clickable icons
public static GuiComposer AddIconListPicker(this GuiComposer composer, string[] icons, Action<int> onToggle, ElementBounds startBounds, int maxLineWidth, string key = null)
Parameters
composer
GuiComposericons
string[]onToggle
Action<int>startBounds
ElementBoundsmaxLineWidth
intkey
string
Returns
AddIconToggleButtons(GuiComposer, string[], CairoFont, Action<int>, ElementBounds[], string)
Adds multiple buttons with icons.
public static GuiComposer AddIconToggleButtons(this GuiComposer composer, string[] icons, CairoFont font, Action<int> onToggle, ElementBounds[] bounds, string key = null)
Parameters
composer
GuiComposericons
string[]The collection of icons for the buttons.
font
CairoFontThe font for the buttons.
onToggle
Action<int>The event called when the buttons are pressed.
bounds
ElementBounds[]The bounds of the buttons.
key
stringThe key given to the bundle of buttons.
Returns
AddInvStatbar(GuiComposer, ElementBounds, double[], string)
Adds a stat bar with filling in the opposite direction. Default values are from 0 to 100.
public static GuiComposer AddInvStatbar(this GuiComposer composer, ElementBounds bounds, double[] color, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsthe bounds of the stat bar.
color
double[]the color of the stat bar.
key
stringThe internal name of the stat bar.
Returns
AddItemSlotGrid(GuiComposer, IInventory, Action<object>, int, int[], ElementBounds, string)
Adds an item slot grid to the GUI.
public static GuiComposer AddItemSlotGrid(this GuiComposer composer, IInventory inventory, Action<object> sendPacket, int columns, int[] selectiveSlots, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposerinventory
IInventoryThe inventory attached to the slot grid.
sendPacket
Action<object>A handler that should send supplied network packet to the server, if the inventory modifications should be synced
columns
intThe number of columns in the slot grid.
selectiveSlots
int[]The slots within the inventory that are currently accessible.
bounds
ElementBoundsthe bounds of the slot grid.
key
stringThe key for this particular slot grid.
Returns
AddItemSlotGrid(GuiComposer, IInventory, Action<object>, int, ElementBounds, string)
Adds an item slot grid to the GUI.
public static GuiComposer AddItemSlotGrid(this GuiComposer composer, IInventory inventory, Action<object> sendPacket, int columns, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposerinventory
IInventoryThe inventory attached to the slot grid.
sendPacket
Action<object>A handler that should send supplied network packet to the server, if the inventory modifications should be synced
columns
intThe number of columns in the slot grid.
bounds
ElementBoundsthe bounds of the slot grid.
key
stringThe key for this particular slot grid.
Returns
AddItemSlotGridExcl(GuiComposer, IInventory, Action<object>, int, int[], ElementBounds, string)
Adds an ItemSlotGrid with Exclusions.
public static GuiComposer AddItemSlotGridExcl(this GuiComposer composer, IInventory inventory, Action<object> sendPacket, int columns, int[] excludingSlots, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposerinventory
IInventoryThe attached inventory.
sendPacket
Action<object>A handler that should send supplied network packet to the server, if the inventory modifications should be synced
columns
intThe number of columns.
excludingSlots
int[]The slots that have been excluded from the slot grid.
bounds
ElementBoundsThe bounds of the slot grid.
key
stringThe name of the slot grid.
Returns
AddMultiSelectDropDown(GuiComposer, string[], string[], int, SelectionChangedDelegate, ElementBounds, string)
Adds a multiple select dropdown to the current GUI instance.
public static GuiComposer AddMultiSelectDropDown(this GuiComposer composer, string[] values, string[] names, int selectedIndex, SelectionChangedDelegate onSelectionChanged, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposervalues
string[]The values of the current drodown.
names
string[]The names of those values.
selectedIndex
intThe default selected index.
onSelectionChanged
SelectionChangedDelegateThe event fired when the index is changed.
bounds
ElementBoundsThe bounds of the index.
key
stringThe name of this dropdown.
Returns
AddNumberInput(GuiComposer, ElementBounds, Action<string>, CairoFont, string)
Adds a numeric input for the current GUI.
public static GuiComposer AddNumberInput(this GuiComposer composer, ElementBounds bounds, Action<string> onTextChanged, CairoFont font = null, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the number input.
onTextChanged
Action<string>The event fired when the number is changed.
font
CairoFontThe font for the numbers.
key
stringThe name for this GuiElementNumberInput
Returns
AddPassiveItemSlot(GuiComposer, ElementBounds, IInventory, ItemSlot, bool)
Adds a passive item slot to the GUI.
public static GuiComposer AddPassiveItemSlot(this GuiComposer composer, ElementBounds bounds, IInventory inventory, ItemSlot slot, bool drawBackground = true)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the Slot
inventory
IInventoryThe inventory attached to the slot.
slot
ItemSlotThe internal slot of the slot.
drawBackground
boolDo we draw the background for this slot? (Default: true)
Returns
AddRichtext(GuiComposer, string, CairoFont, ElementBounds, Action<LinkTextComponent>, string)
Adds a rich text element to the GUI
public static GuiComposer AddRichtext(this GuiComposer composer, string vtmlCode, CairoFont baseFont, ElementBounds bounds, Action<LinkTextComponent> didClickLink, string key = null)
Parameters
composer
GuiComposervtmlCode
stringbaseFont
CairoFontbounds
ElementBoundsdidClickLink
Action<LinkTextComponent>key
string
Returns
AddRichtext(GuiComposer, string, CairoFont, ElementBounds, string)
Adds a rich text element to the GUI
public static GuiComposer AddRichtext(this GuiComposer composer, string vtmlCode, CairoFont baseFont, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposervtmlCode
stringbaseFont
CairoFontbounds
ElementBoundskey
string
Returns
AddRichtext(GuiComposer, RichTextComponentBase[], ElementBounds, string)
Adds a rich text element to the GUI
public static GuiComposer AddRichtext(this GuiComposer composer, RichTextComponentBase[] components, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposercomponents
RichTextComponentBase[]bounds
ElementBoundskey
string
Returns
AddShadedDialogBG(GuiComposer, ElementBounds, bool, double, float)
Adds shaded, slighlty dirt textured background to the GUI.
public static GuiComposer AddShadedDialogBG(this GuiComposer composer, ElementBounds bounds, bool withTitleBar = true, double strokeWidth = 5, float alpha = 0.75)
Parameters
composer
GuiComposerbounds
ElementBoundswithTitleBar
boolstrokeWidth
doublealpha
float
Returns
AddSkillItemGrid(GuiComposer, List<SkillItem>, int, int, Action<int>, ElementBounds, string)
Adds a skill item grid to the GUI.
public static GuiComposer AddSkillItemGrid(this GuiComposer composer, List<SkillItem> skillItems, int columns, int rows, Action<int> onSlotClick, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposerskillItems
List<SkillItem>The items that represent skills.
columns
intthe columns in the skill item grid.
rows
intThe rows in the skill item grid.
onSlotClick
Action<int>The effect when a slot is clicked.
bounds
ElementBoundsThe bounds of the item grid.
key
stringThe name of the item grid to add.
Returns
AddSlider(GuiComposer, ActionConsumable<int>, ElementBounds, string)
Adds a slider to the current GUI.
public static GuiComposer AddSlider(this GuiComposer composer, ActionConsumable<int> onNewSliderValue, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposeronNewSliderValue
ActionConsumable<int>The event that fires when the slider's value is changed.
bounds
ElementBoundsThe bounds of the slider.
key
stringthe internal name of the slider.
Returns
AddSmallButton(GuiComposer, string, ActionConsumable, ElementBounds, EnumButtonStyle, string)
Adds a small clickable button with font size GuiStyle.SmallFontSize
public static GuiComposer AddSmallButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, EnumButtonStyle style = EnumButtonStyle.Normal, string key = null)
Parameters
composer
GuiComposertext
stringThe text displayed inside the button
onClick
ActionConsumableHandler for when the button is clicked
bounds
ElementBoundsstyle
EnumButtonStylekey
string
Returns
AddSmallButton(GuiComposer, string, ActionConsumable, ElementBounds, EnumButtonStyle, EnumTextOrientation, string)
[Obsolete("Use Method without orientation argument")]
public static GuiComposer AddSmallButton(this GuiComposer composer, string text, ActionConsumable onClick, ElementBounds bounds, EnumButtonStyle style, EnumTextOrientation orientation, string key = null)
Parameters
composer
GuiComposertext
stringonClick
ActionConsumablebounds
ElementBoundsstyle
EnumButtonStyleorientation
EnumTextOrientationkey
string
Returns
AddStatbar(GuiComposer, ElementBounds, double[], bool, string)
Adds a stat bar to the current GUI with a minimum of 0 and a maximum of 100.
public static GuiComposer AddStatbar(this GuiComposer composer, ElementBounds bounds, double[] color, bool hideable, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the stat bar.
color
double[]The color of the stat bar.
hideable
boolIf true, the element can be fully hidden without recompose.
key
stringThe internal name of the stat bar.
Returns
AddStatbar(GuiComposer, ElementBounds, double[], string)
public static GuiComposer AddStatbar(this GuiComposer composer, ElementBounds bounds, double[] color, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundscolor
double[]key
string
Returns
AddStaticCustomDraw(GuiComposer, ElementBounds, DrawDelegateWithBounds)
Adds a static custom draw component to the GUI.
public static GuiComposer AddStaticCustomDraw(this GuiComposer composer, ElementBounds bounds, DrawDelegateWithBounds onDraw)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the component.
onDraw
DrawDelegateWithBoundsThe event fired when the element is drawn.
Returns
AddStaticText(GuiComposer, string, CairoFont, ElementBounds, string)
Adds a static text component to the GUI
public static GuiComposer AddStaticText(this GuiComposer composer, string text, CairoFont font, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text component.
font
CairoFontThe font of the text.
bounds
ElementBoundsThe bounds of the text container.
key
stringThe name of the component.
Returns
AddStaticText(GuiComposer, string, CairoFont, EnumTextOrientation, ElementBounds, string)
Adds a static text component to the GUI
public static GuiComposer AddStaticText(this GuiComposer composer, string text, CairoFont font, EnumTextOrientation orientation, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text component.
font
CairoFontThe font of the text.
orientation
EnumTextOrientationThe orientation of the text.
bounds
ElementBoundsThe bounds of the text container.
key
stringThe name of the component.
Returns
AddStaticTextAutoBoxSize(GuiComposer, string, CairoFont, EnumTextOrientation, ElementBounds, string)
Adds a static text component to the GUI that automatically resizes as necessary.
public static GuiComposer AddStaticTextAutoBoxSize(this GuiComposer composer, string text, CairoFont font, EnumTextOrientation orientation, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text component.
font
CairoFontThe font of the text.
orientation
EnumTextOrientationThe orientation of the text.
bounds
ElementBoundsThe bounds of the text container.
key
stringThe name of the component.
Returns
AddStaticTextAutoFontSize(GuiComposer, string, CairoFont, ElementBounds, string)
Adds a static text component to the GUI that automatically resizes as necessary.
public static GuiComposer AddStaticTextAutoFontSize(this GuiComposer composer, string text, CairoFont font, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text component.
font
CairoFontThe font of the text.
bounds
ElementBoundsThe bounds of the text container.
key
stringThe name of the component.
Returns
AddSwitch(GuiComposer, Action<bool>, ElementBounds, string, double, double)
Adds a switch to the GUI.
public static GuiComposer AddSwitch(this GuiComposer composer, Action<bool> onToggle, ElementBounds bounds, string key = null, double size = 30, double padding = 4)
Parameters
composer
GuiComposeronToggle
Action<bool>The event that happens when the switch is toggled.
bounds
ElementBoundsThe bounds of the switch.
key
stringthe name of the switch. (Default: null)
size
doubleThe size of the switch (Default: 30)
padding
doubleThe padding around the switch (Default: 5)
Returns
AddTextArea(GuiComposer, ElementBounds, Action<string>, CairoFont, string)
Adds a text area to the GUI.
public static GuiComposer AddTextArea(this GuiComposer composer, ElementBounds bounds, Action<string> onTextChanged, CairoFont font = null, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the Text Area
onTextChanged
Action<string>The event fired when the text is changed.
font
CairoFontThe font of the text.
key
stringThe name of the text area.
Returns
AddTextInput(GuiComposer, ElementBounds, Action<string>, CairoFont, string)
Adds a text input to the current GUI.
public static GuiComposer AddTextInput(this GuiComposer composer, ElementBounds bounds, Action<string> onTextChanged, CairoFont font = null, string key = null)
Parameters
composer
GuiComposerbounds
ElementBoundsThe bounds of the text input.
onTextChanged
Action<string>The event fired when the text is changed.
font
CairoFontThe font of the text.
key
stringThe name of this text component.
Returns
AddTextToggleButtons(GuiComposer, string[], CairoFont, Action<int>, ElementBounds[], string)
Adds multiple buttons with Text.
public static GuiComposer AddTextToggleButtons(this GuiComposer composer, string[] texts, CairoFont font, Action<int> onToggle, ElementBounds[] bounds, string key = null)
Parameters
composer
GuiComposertexts
string[]The texts on all the buttons.
font
CairoFontThe font for the buttons
onToggle
Action<int>The event fired when the button is pressed.
bounds
ElementBounds[]The bounds of the buttons.
key
stringThe key given to the bundle of buttons.
Returns
AddToggleButton(GuiComposer, string, CairoFont, Action<bool>, ElementBounds, string)
Creates a toggle button with the given parameters.
public static GuiComposer AddToggleButton(this GuiComposer composer, string text, CairoFont font, Action<bool> onToggle, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the button.
font
CairoFontThe font of the text.
onToggle
Action<bool>The event that happens once the button is toggled.
bounds
ElementBoundsThe bounding box of the button.
key
stringThe name of the button for easy access.
Returns
AddTranspHoverText(GuiComposer, string, CairoFont, int, ElementBounds, string)
Adds a hover text to the GUI.
public static GuiComposer AddTranspHoverText(this GuiComposer composer, string text, CairoFont font, int width, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposertext
stringThe text of the text.
font
CairoFontThe font of the text.
width
intThe width of the text.
bounds
ElementBoundsThe bounds of the text.
key
stringThe name of this hover text component.
Returns
AddVerticalScrollbar(GuiComposer, Action<float>, ElementBounds, string)
Adds a vertical scrollbar to the GUI.
public static GuiComposer AddVerticalScrollbar(this GuiComposer composer, Action<float> onNewScrollbarValue, ElementBounds bounds, string key = null)
Parameters
composer
GuiComposeronNewScrollbarValue
Action<float>The action when the scrollbar changes.
bounds
ElementBoundsThe bounds of the scrollbar.
key
stringThe name of the scrollbar.
Returns
AddVerticalTabs(GuiComposer, GuiTab[], ElementBounds, Action<int, GuiTab>, string)
Adds multiple tabs to a group of vertical tabs.
public static GuiComposer AddVerticalTabs(this GuiComposer composer, GuiTab[] tabs, ElementBounds bounds, Action<int, GuiTab> onTabClicked, string key = null)
Parameters
composer
GuiComposertabs
GuiTab[]The tabs being added.
bounds
ElementBoundsThe boundaries of the tab group.
onTabClicked
Action<int, GuiTab>The event fired when any of the tabs are clicked.
key
stringThe name of this tab group.
Returns
AddVerticalToggleTabs(GuiComposer, GuiTab[], ElementBounds, Action<int, GuiTab>, string)
Adds multiple tabs to a group of vertical tabs.
public static GuiComposer AddVerticalToggleTabs(this GuiComposer composer, GuiTab[] tabs, ElementBounds bounds, Action<int, GuiTab> onTabClicked, string key = null)
Parameters
composer
GuiComposertabs
GuiTab[]The tabs being added.
bounds
ElementBoundsThe boundaries of the tab group.
onTabClicked
Action<int, GuiTab>The event fired when any of the tabs are clicked.
key
stringThe name of this tab group.
Returns
ColorListPickerSetValue(GuiComposer, string, int)
Selects one of the colors from a color list picker
public static void ColorListPickerSetValue(this GuiComposer composer, string key, int selectedIndex)
Parameters
composer
GuiComposerkey
stringselectedIndex
int
GetButton(GuiComposer, string)
Gets the button by name
public static GuiElementTextButton GetButton(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetCellList<T>(GuiComposer, string)
Gets the list by name.
public static GuiElementCellList<T> GetCellList<T>(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the list to get.
Returns
Type Parameters
T
GetChatInput(GuiComposer, string)
Gets the chat input by name.
public static GuiElementChatInput GetChatInput(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the chat input component.
Returns
- GuiElementChatInput
The named component.
GetColorListPicker(GuiComposer, string)
Returns a previously added color list picker element
public static GuiElementColorListPicker GetColorListPicker(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetCompactScrollbar(GuiComposer, string)
Gets the scrollbar from the dialogue.
public static GuiElementCompactScrollbar GetCompactScrollbar(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringthe internal name of the scrollbar to be gotten
Returns
- GuiElementCompactScrollbar
The scrollbar with the given key.
GetConfigList(GuiComposer, string)
Gets the config list by name.
public static GuiElementConfigList GetConfigList(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the config list.
Returns
GetContainer(GuiComposer, string)
Gets the container by key
public static GuiElementContainer GetContainer(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the list to get.
Returns
GetCustomDraw(GuiComposer, string)
public static GuiElementCustomDraw GetCustomDraw(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetCustomRender(GuiComposer, string)
public static GuiElementCustomRender GetCustomRender(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetDropDown(GuiComposer, string)
Gets the Drop Down element from the GUIComposer by their key.
public static GuiElementDropDown GetDropDown(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringthe name of the dropdown to fetch.
Returns
GetEmbossedText(GuiComposer, string)
Gets the EmbossedText component by name.
public static GuiElementEmbossedText GetEmbossedText(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the component.
Returns
- GuiElementEmbossedText
the named component of the text.
GetHorizontalTabs(GuiComposer, string)
Gets the HorizontalTabs element from the GUI by name.
public static GuiElementHorizontalTabs GetHorizontalTabs(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe key for the horizontal tabs you want to get.
Returns
GetHoverText(GuiComposer, string)
Fetches the hover text component by name.
public static GuiElementHoverText GetHoverText(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the text component.
Returns
GetIconListPicker(GuiComposer, string)
Returns the icon list picker
public static GuiElementIconListPicker GetIconListPicker(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetNumberInput(GuiComposer, string)
Gets the number input by name.
public static GuiElementNumberInput GetNumberInput(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe internal name of the numeric input.
Returns
- GuiElementNumberInput
The named numeric input.
GetRichtext(GuiComposer, string)
Gets the chat input by name.
public static GuiElementRichtext GetRichtext(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the chat input component.
Returns
- GuiElementRichtext
The named component.
GetScrollbar(GuiComposer, string)
Gets the scrollbar by name.
public static GuiElementScrollbar GetScrollbar(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the scrollbar.
Returns
- GuiElementScrollbar
The scrollbar itself.
GetSkillItemGrid(GuiComposer, string)
Fetches the skill item grid by name
public static GuiElementSkillItemGrid GetSkillItemGrid(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the skill item grid to get.
Returns
- GuiElementSkillItemGrid
The skill item grid to get.
GetSlider(GuiComposer, string)
Gets the slider by name from the GUI.
public static GuiElementSlider GetSlider(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringthe internal name of the slider.
Returns
- GuiElementSlider
the slider.
GetSlotGrid(GuiComposer, string)
Gets the slot grid by name.
public static GuiElementItemSlotGrid GetSlotGrid(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the slot grid to get.
Returns
GetSlotGridExcl(GuiComposer, string)
Gets the ItemSlotGridExcl by name.
public static GuiElementItemSlotGridExcl GetSlotGridExcl(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the ItemSlotGridExcl
Returns
GetStatbar(GuiComposer, string)
Gets the stat bar by name.
public static GuiElementStatbar GetStatbar(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe internal name of the stat bar to fetch.
Returns
- GuiElementStatbar
The named stat bar.
GetStaticText(GuiComposer, string)
Gets the static text component by name.
public static GuiElementStaticText GetStaticText(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the component.
Returns
GetSwitch(GuiComposer, string)
Gets the switch by name.
public static GuiElementSwitch GetSwitch(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe internal name of the switch.
Returns
- GuiElementSwitch
Returns the named switch.
GetTextArea(GuiComposer, string)
Gets the text area by name.
public static GuiElementTextArea GetTextArea(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the text area.
Returns
- GuiElementTextArea
The named Text Area.
GetTextInput(GuiComposer, string)
Gets the text input by input name.
public static GuiElementTextInput GetTextInput(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the text input to get.
Returns
- GuiElementTextInput
The named text input
GetTitleBar(GuiComposer, string)
public static GuiElementDialogTitleBar GetTitleBar(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
string
Returns
GetToggleButton(GuiComposer, string)
Gets the toggle button by name in the GUIComposer.
public static GuiElementToggleButton GetToggleButton(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the button.
Returns
- GuiElementToggleButton
A button.
GetVerticalTab(GuiComposer, string)
Gets the vertical tab group as declared by name.
public static GuiElementVerticalTabs GetVerticalTab(this GuiComposer composer, string key)
Parameters
composer
GuiComposerkey
stringThe name of the vertical tab group to get.
Returns
IconListPickerSetValue(GuiComposer, string, int)
Selects one of the clickable icons
public static void IconListPickerSetValue(this GuiComposer composer, string key, int selectedIndex)
Parameters
composer
GuiComposerkey
stringselectedIndex
int
ToggleButtonsSetValue(GuiComposer, string, int)
Toggles the given button.
public static void ToggleButtonsSetValue(this GuiComposer composer, string key, int selectedIndex)
Parameters
composer
GuiComposerkey
stringThe name of the button that was set.
selectedIndex
intthe index of the button.