Table of Contents

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 GuiComposer
text string
font CairoFont
width int
bounds ElementBounds
key string

Returns

GuiComposer

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 GuiComposer
text string

The text displayed inside the button

onClick ActionConsumable

Handler for when the button is clicked

bounds ElementBounds
buttonFont CairoFont

The font to be used for the text inside the button.

style EnumButtonStyle
key string

Returns

GuiComposer

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 GuiComposer
text string
onClick ActionConsumable
bounds ElementBounds
buttonFont CairoFont
style EnumButtonStyle
orientation EnumTextOrientation
key string

Returns

GuiComposer

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 GuiComposer
text string

The text displayed inside the button

onClick ActionConsumable

Handler for when the button is clicked

bounds ElementBounds
style EnumButtonStyle
key string

Returns

GuiComposer

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 GuiComposer
text string
onClick ActionConsumable
bounds ElementBounds
style EnumButtonStyle
orientation EnumTextOrientation
key string

Returns

GuiComposer

AddCellList<T>(GuiComposer, ElementBounds, OnRequireCell<T>, List<T>, string)

Adds a List to the current GUI.

public static GuiComposer AddCellList<T>(this GuiComposer composer, ElementBounds bounds, OnRequireCell<T> cellCreator, List<T> cells = null, string key = null)

Parameters

composer GuiComposer
bounds ElementBounds

The bounds of the cell.

cellCreator OnRequireCell<T>

the event fired when the cell is requested by the GUI

cells List<T>

The cells of the list.

key string

The identifier for the list.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the text.

onTextChanged Action<string>

The event fired when the text is changed.

key string

The name of this chat component.

Returns

GuiComposer

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 GuiComposer
colors int[]
onToggle Action<int>
startBounds ElementBounds
maxLineWidth int
key string

Returns

GuiComposer

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 GuiComposer
onNewScrollbarValue Action<float>

The event fired for the change in the scrollbar.

bounds ElementBounds

the bounds of the scrollbar.

key string

the internal name of the scrollbar.

Returns

GuiComposer

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 GuiComposer
items List<ConfigItem>

The items to add.

onItemClick ConfigItemClickDelegate

The event fired when the item is clicked.

font CairoFont

The font of the Config List.

bounds ElementBounds

The bounds of the config list.

key string

The name of the config list.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the cell.

key string

The identifier for the list.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the component.

onRender RenderDelegateWithBounds

The event fired when the element is drawn.

Returns

GuiComposer

AddDialogBG(GuiComposer, ElementBounds, bool, float)

public static GuiComposer AddDialogBG(this GuiComposer composer, ElementBounds bounds, bool withTitleBar = true, float alpha = 1)

Parameters

composer GuiComposer
bounds ElementBounds
withTitleBar bool
alpha float

Returns

GuiComposer

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 GuiComposer
text string

The text of the title bar.

onClose Action

The event fired when the title bar is closed.

font CairoFont

The font of the title bar.

bounds ElementBounds

The bounds of the title bar.

Returns

GuiComposer

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 GuiComposer
text string

The text of the title bar.

onClose Action

The event fired when the title bar is closed.

font CairoFont

The font of the title bar.

bounds ElementBounds

The bounds of the title bar.

Returns

GuiComposer

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 GuiComposer
values string[]

The values of the current drodown.

names string[]

The names of those values.

selectedIndex int

The default selected index.

onSelectionChanged SelectionChangedDelegate

The event fired when the index is changed.

bounds ElementBounds

The bounds of the index.

key string

The name of this dropdown.

Returns

GuiComposer

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 GuiComposer
values string[]

The values of the current drodown.

names string[]

The names of those values.

selectedIndex int

The default selected index.

onSelectionChanged SelectionChangedDelegate

The event fired when the index is changed.

bounds ElementBounds

The bounds of the index.

font CairoFont
key string

The name of this dropdown.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the component.

onDraw DrawDelegateWithBounds

The event fired when the element is drawn.

key string

The name of the element.

Returns

GuiComposer

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 GuiComposer
pickertype Type
elems T[]
onToggle Action<int>

The event fired when the button is pressed.

startBounds ElementBounds

The bounds of the buttons.

maxLineWidth int
key string

The key given to the bundle of buttons.

Returns

GuiComposer

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 GuiComposer
text string

The text of the component.

font CairoFont

The font of the text.

bounds ElementBounds

The bounds of the component.

key string

The name of the component.

Returns

GuiComposer

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 GuiComposer
tabs GuiTab[]

The collection of tabs.

bounds ElementBounds

The bounds of the horizontal tabs.

onTabClicked Action<int>

The event fired when the tab is clicked.

font CairoFont

The font of the tabs.

selectedFont CairoFont
key string

The key for the added horizontal tabs.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text.

font CairoFont

The font of the text.

width int

The width of the text.

bounds ElementBounds

The bounds of the text.

key string

The name of this hover text component.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text.

font CairoFont

The font of the text.

width int

The width of the text.

bounds ElementBounds

The bounds of the text.

background TextBackground
key string

The name of this hover text component.

Returns

GuiComposer

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 GuiComposer
icon string

The name of the icon.

onToggle Action<bool>

The event that happens once the button is toggled.

bounds ElementBounds

The bounding box of the button.

key string

The name of the button for easy access.

Returns

GuiComposer

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 GuiComposer
icons string[]
onToggle Action<int>
startBounds ElementBounds
maxLineWidth int
key string

Returns

GuiComposer

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 GuiComposer
icons string[]

The collection of icons for the buttons.

font CairoFont

The font for the buttons.

onToggle Action<int>

The event called when the buttons are pressed.

bounds ElementBounds[]

The bounds of the buttons.

key string

The key given to the bundle of buttons.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

the bounds of the stat bar.

color double[]

the color of the stat bar.

key string

The internal name of the stat bar.

Returns

GuiComposer

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 GuiComposer
inventory IInventory

The 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 int

The number of columns in the slot grid.

selectiveSlots int[]

The slots within the inventory that are currently accessible.

bounds ElementBounds

the bounds of the slot grid.

key string

The key for this particular slot grid.

Returns

GuiComposer

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 GuiComposer
inventory IInventory

The 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 int

The number of columns in the slot grid.

bounds ElementBounds

the bounds of the slot grid.

key string

The key for this particular slot grid.

Returns

GuiComposer

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 GuiComposer
inventory IInventory

The attached inventory.

sendPacket Action<object>

A handler that should send supplied network packet to the server, if the inventory modifications should be synced

columns int

The number of columns.

excludingSlots int[]

The slots that have been excluded from the slot grid.

bounds ElementBounds

The bounds of the slot grid.

key string

The name of the slot grid.

Returns

GuiComposer

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 GuiComposer
values string[]

The values of the current drodown.

names string[]

The names of those values.

selectedIndex int

The default selected index.

onSelectionChanged SelectionChangedDelegate

The event fired when the index is changed.

bounds ElementBounds

The bounds of the index.

key string

The name of this dropdown.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the number input.

onTextChanged Action<string>

The event fired when the number is changed.

font CairoFont

The font for the numbers.

key string

The name for this GuiElementNumberInput

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the Slot

inventory IInventory

The inventory attached to the slot.

slot ItemSlot

The internal slot of the slot.

drawBackground bool

Do we draw the background for this slot? (Default: true)

Returns

GuiComposer

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 GuiComposer
vtmlCode string
baseFont CairoFont
bounds ElementBounds
didClickLink Action<LinkTextComponent>
key string

Returns

GuiComposer

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 GuiComposer
vtmlCode string
baseFont CairoFont
bounds ElementBounds
key string

Returns

GuiComposer

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 GuiComposer
components RichTextComponentBase[]
bounds ElementBounds
key string

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds
withTitleBar bool
strokeWidth double
alpha float

Returns

GuiComposer

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 GuiComposer
skillItems List<SkillItem>

The items that represent skills.

columns int

the columns in the skill item grid.

rows int

The rows in the skill item grid.

onSlotClick Action<int>

The effect when a slot is clicked.

bounds ElementBounds

The bounds of the item grid.

key string

The name of the item grid to add.

Returns

GuiComposer

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 GuiComposer
onNewSliderValue ActionConsumable<int>

The event that fires when the slider's value is changed.

bounds ElementBounds

The bounds of the slider.

key string

the internal name of the slider.

Returns

GuiComposer

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 GuiComposer
text string

The text displayed inside the button

onClick ActionConsumable

Handler for when the button is clicked

bounds ElementBounds
style EnumButtonStyle
key string

Returns

GuiComposer

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 GuiComposer
text string
onClick ActionConsumable
bounds ElementBounds
style EnumButtonStyle
orientation EnumTextOrientation
key string

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the stat bar.

color double[]

The color of the stat bar.

hideable bool

If true, the element can be fully hidden without recompose.

key string

The internal name of the stat bar.

Returns

GuiComposer

AddStatbar(GuiComposer, ElementBounds, double[], string)

public static GuiComposer AddStatbar(this GuiComposer composer, ElementBounds bounds, double[] color, string key = null)

Parameters

composer GuiComposer
bounds ElementBounds
color double[]
key string

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the component.

onDraw DrawDelegateWithBounds

The event fired when the element is drawn.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text component.

font CairoFont

The font of the text.

bounds ElementBounds

The bounds of the text container.

key string

The name of the component.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text component.

font CairoFont

The font of the text.

orientation EnumTextOrientation

The orientation of the text.

bounds ElementBounds

The bounds of the text container.

key string

The name of the component.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text component.

font CairoFont

The font of the text.

orientation EnumTextOrientation

The orientation of the text.

bounds ElementBounds

The bounds of the text container.

key string

The name of the component.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text component.

font CairoFont

The font of the text.

bounds ElementBounds

The bounds of the text container.

key string

The name of the component.

Returns

GuiComposer

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 GuiComposer
onToggle Action<bool>

The event that happens when the switch is toggled.

bounds ElementBounds

The bounds of the switch.

key string

the name of the switch. (Default: null)

size double

The size of the switch (Default: 30)

padding double

The padding around the switch (Default: 5)

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the Text Area

onTextChanged Action<string>

The event fired when the text is changed.

font CairoFont

The font of the text.

key string

The name of the text area.

Returns

GuiComposer

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 GuiComposer
bounds ElementBounds

The bounds of the text input.

onTextChanged Action<string>

The event fired when the text is changed.

font CairoFont

The font of the text.

key string

The name of this text component.

Returns

GuiComposer

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 GuiComposer
texts string[]

The texts on all the buttons.

font CairoFont

The font for the buttons

onToggle Action<int>

The event fired when the button is pressed.

bounds ElementBounds[]

The bounds of the buttons.

key string

The key given to the bundle of buttons.

Returns

GuiComposer

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 GuiComposer
text string

The text of the button.

font CairoFont

The font of the text.

onToggle Action<bool>

The event that happens once the button is toggled.

bounds ElementBounds

The bounding box of the button.

key string

The name of the button for easy access.

Returns

GuiComposer

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 GuiComposer
text string

The text of the text.

font CairoFont

The font of the text.

width int

The width of the text.

bounds ElementBounds

The bounds of the text.

key string

The name of this hover text component.

Returns

GuiComposer

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 GuiComposer
onNewScrollbarValue Action<float>

The action when the scrollbar changes.

bounds ElementBounds

The bounds of the scrollbar.

key string

The name of the scrollbar.

Returns

GuiComposer

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 GuiComposer
tabs GuiTab[]

The tabs being added.

bounds ElementBounds

The boundaries of the tab group.

onTabClicked Action<int, GuiTab>

The event fired when any of the tabs are clicked.

key string

The name of this tab group.

Returns

GuiComposer

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 GuiComposer
tabs GuiTab[]

The tabs being added.

bounds ElementBounds

The boundaries of the tab group.

onTabClicked Action<int, GuiTab>

The event fired when any of the tabs are clicked.

key string

The name of this tab group.

Returns

GuiComposer

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 GuiComposer
key string
selectedIndex int

GetButton(GuiComposer, string)

Gets the button by name

public static GuiElementTextButton GetButton(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

Returns

GuiElementTextButton

GetCellList<T>(GuiComposer, string)

Gets the list by name.

public static GuiElementCellList<T> GetCellList<T>(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The name of the list to get.

Returns

GuiElementCellList<T>

Type Parameters

T

GetChatInput(GuiComposer, string)

Gets the chat input by name.

public static GuiElementChatInput GetChatInput(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

Returns

GuiElementColorListPicker

GetCompactScrollbar(GuiComposer, string)

Gets the scrollbar from the dialogue.

public static GuiElementCompactScrollbar GetCompactScrollbar(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

the 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 GuiComposer
key string

The name of the config list.

Returns

GuiElementConfigList

GetContainer(GuiComposer, string)

Gets the container by key

public static GuiElementContainer GetContainer(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The name of the list to get.

Returns

GuiElementContainer

GetCustomDraw(GuiComposer, string)

public static GuiElementCustomDraw GetCustomDraw(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

Returns

GuiElementCustomDraw

GetCustomRender(GuiComposer, string)

public static GuiElementCustomRender GetCustomRender(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

Returns

GuiElementCustomRender

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 GuiComposer
key string

the name of the dropdown to fetch.

Returns

GuiElementDropDown

GetEmbossedText(GuiComposer, string)

Gets the EmbossedText component by name.

public static GuiElementEmbossedText GetEmbossedText(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

The key for the horizontal tabs you want to get.

Returns

GuiElementHorizontalTabs

GetHoverText(GuiComposer, string)

Fetches the hover text component by name.

public static GuiElementHoverText GetHoverText(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The name of the text component.

Returns

GuiElementHoverText

GetIconListPicker(GuiComposer, string)

Returns the icon list picker

public static GuiElementIconListPicker GetIconListPicker(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

Returns

GuiElementIconListPicker

GetNumberInput(GuiComposer, string)

Gets the number input by name.

public static GuiElementNumberInput GetNumberInput(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

The 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 GuiComposer
key string

The 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 GuiComposer
key string

The 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 GuiComposer
key string

the 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 GuiComposer
key string

The name of the slot grid to get.

Returns

GuiElementItemSlotGrid

GetSlotGridExcl(GuiComposer, string)

Gets the ItemSlotGridExcl by name.

public static GuiElementItemSlotGridExcl GetSlotGridExcl(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The name of the ItemSlotGridExcl

Returns

GuiElementItemSlotGridExcl

GetStatbar(GuiComposer, string)

Gets the stat bar by name.

public static GuiElementStatbar GetStatbar(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

The name of the component.

Returns

GuiElementStaticText

GetSwitch(GuiComposer, string)

Gets the switch by name.

public static GuiElementSwitch GetSwitch(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

The 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 GuiComposer
key string

The 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 GuiComposer
key string

Returns

GuiElementDialogTitleBar

GetToggleButton(GuiComposer, string)

Gets the toggle button by name in the GUIComposer.

public static GuiElementToggleButton GetToggleButton(this GuiComposer composer, string key)

Parameters

composer GuiComposer
key string

The 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 GuiComposer
key string

The name of the vertical tab group to get.

Returns

GuiElementVerticalTabs

IconListPickerSetValue(GuiComposer, string, int)

Selects one of the clickable icons

public static void IconListPickerSetValue(this GuiComposer composer, string key, int selectedIndex)

Parameters

composer GuiComposer
key string
selectedIndex int

ToggleButtonsSetValue(GuiComposer, string, int)

Toggles the given button.

public static void ToggleButtonsSetValue(this GuiComposer composer, string key, int selectedIndex)

Parameters

composer GuiComposer
key string

The name of the button that was set.

selectedIndex int

the index of the button.