GUI

Barotrauma.GUI

Functions

Equals(obj)

Equals

Parameters

  • obj Object

Returns

  • bool

GUI.AddMessage(message, color, lifeTime, playSound, font)

AddMessage

Parameters

  • message LocalizedString

  • color Microsoft.Xna.Framework.Color

  • lifeTime optional Single

  • playSound bool

  • font GUIFont

GUI.AddMessage(message, color, pos, velocity, lifeTime, playSound, soundType, subId)

AddMessage

Parameters

  • message LocalizedString

  • color Microsoft.Xna.Framework.Color

  • pos Microsoft.Xna.Framework.Vector2

  • velocity Microsoft.Xna.Framework.Vector2

  • lifeTime number

  • playSound bool

  • soundType GUISoundType

  • subId number

GUI.AddMessage(message, color, pos, velocity, lifeTime, playSound, soundType, subId)

AddMessage

Parameters

  • color Microsoft.Xna.Framework.Color

  • pos Microsoft.Xna.Framework.Vector2

  • velocity Microsoft.Xna.Framework.Vector2

  • lifeTime number

  • playSound bool

  • soundType GUISoundType

  • subId number

GUI.AddMessage(message, color, lifeTime, playSound, font)

AddMessage

Parameters

  • color Microsoft.Xna.Framework.Color

  • lifeTime optional Single

  • playSound bool

  • font GUIFont

GUI.AddToUpdateList(component)

AddToUpdateList

Parameters

  • component GUIComponent

GUI.AdjustForTextScale(f)

AdjustForTextScale

Parameters

  • f number

Returns

  • number

GUI.AskForConfirmation(header, body, onConfirm, onDeny, relativeSize, minSize)

AskForConfirmation

Parameters

  • header LocalizedString

  • body LocalizedString

  • onConfirm Action

  • onDeny Action

  • relativeSize optional Microsoft.Xna.Framework.Vector2

  • minSize optional Microsoft.Xna.Framework.Point

Returns

  • GUIMessageBox

GUI.ClearCursorWait()

ClearCursorWait

GUI.ClearMessages()

ClearMessages

GUI.ClearUpdateList()

ClearUpdateList

GUI.CreateButtons(count, relativeSize, parent, anchor, pivot, minSize, maxSize, absoluteSpacing, relativeSpacing, extraSpacing, startOffsetAbsolute, startOffsetRelative, isHorizontal, textAlignment, style)

CreateButtons

Parameters

  • count number

  • relativeSize Microsoft.Xna.Framework.Vector2

  • parent RectTransform

  • anchor Anchor

  • pivot optional Pivot

  • minSize optional Microsoft.Xna.Framework.Point

  • maxSize optional Microsoft.Xna.Framework.Point

  • absoluteSpacing number

  • relativeSpacing number

  • extraSpacing function

  • startOffsetAbsolute number

  • startOffsetRelative number

  • isHorizontal bool

  • textAlignment Alignment

Returns

GUI.CreateButtons(count, absoluteSize, parent, anchor, pivot, absoluteSpacing, relativeSpacing, extraSpacing, startOffsetAbsolute, startOffsetRelative, isHorizontal, textAlignment, style)

CreateButtons

Parameters

  • count number

  • absoluteSize Microsoft.Xna.Framework.Point

  • parent RectTransform

  • anchor Anchor

  • pivot optional Pivot

  • absoluteSpacing number

  • relativeSpacing number

  • extraSpacing function

  • startOffsetAbsolute number

  • startOffsetRelative number

  • isHorizontal bool

  • textAlignment Alignment

Returns

GUI.CreateCapsule(radius, height)

CreateCapsule

Parameters

  • radius number

  • height number

Returns

  • Microsoft.Xna.Framework.Graphics.Texture2D

GUI.CreateCircle(radius, filled)

CreateCircle

Parameters

  • radius number

  • filled bool

Returns

  • Microsoft.Xna.Framework.Graphics.Texture2D

GUI.CreateElements(count, absoluteSize, parent, constructor, anchor, pivot, absoluteSpacing, relativeSpacing, extraSpacing, startOffsetAbsolute, startOffsetRelative, isHorizontal)

CreateElements

Parameters

  • count number

  • absoluteSize Microsoft.Xna.Framework.Point

  • parent RectTransform

  • constructor function

  • anchor Anchor

  • pivot optional Pivot

  • absoluteSpacing number

  • relativeSpacing number

  • extraSpacing function

  • startOffsetAbsolute number

  • startOffsetRelative number

  • isHorizontal bool

Returns

GUI.CreateElements(count, relativeSize, parent, constructor, anchor, pivot, minSize, maxSize, absoluteSpacing, relativeSpacing, extraSpacing, startOffsetAbsolute, startOffsetRelative, isHorizontal)

CreateElements

Parameters

  • count number

  • relativeSize Microsoft.Xna.Framework.Vector2

  • parent RectTransform

  • constructor function

  • anchor Anchor

  • pivot optional Pivot

  • minSize optional Microsoft.Xna.Framework.Point

  • maxSize optional Microsoft.Xna.Framework.Point

  • absoluteSpacing number

  • relativeSpacing number

  • extraSpacing function

  • startOffsetAbsolute number

  • startOffsetRelative number

  • isHorizontal bool

Returns

GUI.CreateEnumField(value, elementHeight, name, parent, toolTip, font)

CreateEnumField

Parameters

  • value Enum

  • elementHeight number

  • name LocalizedString

  • parent RectTransform

  • font GUIFont

Returns

  • GUIComponent

GUI.CreatePointField(value, elementHeight, displayName, parent, toolTip)

CreatePointField

Parameters

  • value Microsoft.Xna.Framework.Point

  • elementHeight number

  • displayName LocalizedString

  • parent RectTransform

  • toolTip LocalizedString

Returns

  • GUIComponent

GUI.CreateRectangle(width, height)

CreateRectangle

Parameters

  • width number

  • height number

Returns

  • Microsoft.Xna.Framework.Graphics.Texture2D

GUI.CreateRectangleField(value, elementHeight, name, parent, toolTip, font)

CreateRectangleField

Parameters

  • value Microsoft.Xna.Framework.Rectangle

  • elementHeight number

  • name LocalizedString

  • parent RectTransform

  • toolTip LocalizedString

  • font GUIFont

Returns

  • GUIComponent

GUI.CreateTextBoxWithPlaceholder(rectT, text, placeholder)

CreateTextBoxWithPlaceholder

Parameters

  • rectT RectTransform

  • placeholder LocalizedString

Returns

  • GUITextBox

GUI.CreateVector2Field(value, elementHeight, name, parent, toolTip, font, decimalsToDisplay)

CreateVector2Field

Parameters

  • value Microsoft.Xna.Framework.Vector2

  • elementHeight number

  • name LocalizedString

  • parent RectTransform

  • toolTip LocalizedString

  • font GUIFont

  • decimalsToDisplay number

Returns

  • GUIComponent

GUI.DisableSavingIndicatorDelayed(delay)

DisableSavingIndicatorDelayed

Parameters

  • delay number

GUI.Draw(cam, spriteBatch)

Draw

Parameters

  • cam Camera

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

GUI.DrawBackgroundSprite(spriteBatch, backgroundSprite, color, drawArea, spriteEffects)

DrawBackgroundSprite

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • backgroundSprite Sprite

  • color Microsoft.Xna.Framework.Color

  • drawArea optional Microsoft.Xna.Framework.Rectangle

  • spriteEffects Microsoft.Xna.Framework.Graphics.SpriteEffects

GUI.DrawBezierWithDots(spriteBatch, start, endparam, control, pointCount, color, dotSize)

DrawBezierWithDots

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • endparam Microsoft.Xna.Framework.Vector2

  • control Microsoft.Xna.Framework.Vector2

  • pointCount number

  • color Microsoft.Xna.Framework.Color

  • dotSize number

GUI.DrawButton(sb, rect, text, color, isHoldable)

DrawButton

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • rect Microsoft.Xna.Framework.Rectangle

  • color Microsoft.Xna.Framework.Color

  • isHoldable bool

Returns

  • bool

GUI.DrawCapsule(sb, origin, length, radius, rotation, clr, depth, thickness)

DrawCapsule

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • origin Microsoft.Xna.Framework.Vector2

  • length number

  • radius number

  • rotation number

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • thickness number

GUI.DrawDonutSection(sb, center, radii, sectionRad, clr, depth, rotationRad)

DrawDonutSection

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • center Microsoft.Xna.Framework.Vector2

  • radii Range

  • sectionRad number

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • rotationRad number

GUI.DrawFilledRectangle(sb, start, size, clr, depth)

DrawFilledRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • clr Microsoft.Xna.Framework.Color

  • depth number

GUI.DrawFilledRectangle(sb, position, size, pivot, rotation, clr, depth)

DrawFilledRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • position Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • pivot Microsoft.Xna.Framework.Vector2

  • rotation number

  • clr Microsoft.Xna.Framework.Color

  • depth number

GUI.DrawFilledRectangle(sb, rect, clr, depth)

DrawFilledRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • rect Microsoft.Xna.Framework.RectangleF

  • clr Microsoft.Xna.Framework.Color

  • depth number

GUI.DrawIndicator(spriteBatch, worldPosition, cam, hideDist, sprite, color, createOffset, scaleMultiplier, overrideAlpha)

DrawIndicator

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • worldPosition Microsoft.Xna.Framework.Vector2

  • cam Camera

  • hideDist number

  • sprite Sprite

  • color Microsoft.Xna.Framework.Color

  • createOffset bool

  • scaleMultiplier number

  • overrideAlpha optional Single

GUI.DrawIndicator(spriteBatch, worldPosition, cam, visibleRange, sprite, color, createOffset, scaleMultiplier, overrideAlpha, label)

DrawIndicator

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • worldPosition Microsoft.Xna.Framework.Vector2&

  • cam Camera

  • visibleRange Range`1&

  • sprite Sprite

  • color Microsoft.Xna.Framework.Color&

  • createOffset bool

  • scaleMultiplier number

  • overrideAlpha optional Single

  • label LocalizedString

GUI.DrawLine(sb, sprite, start, endparam, clr, depth, width)

DrawLine

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • sprite Sprite

  • start Microsoft.Xna.Framework.Vector2

  • endparam Microsoft.Xna.Framework.Vector2

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • width number

GUI.DrawLine(sb, texture, start, endparam, clr, depth, width)

DrawLine

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • texture Microsoft.Xna.Framework.Graphics.Texture2D

  • start Microsoft.Xna.Framework.Vector2

  • endparam Microsoft.Xna.Framework.Vector2

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • width number

GUI.DrawLine(sb, start, endparam, clr, depth, width)

DrawLine

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • endparam Microsoft.Xna.Framework.Vector2

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • width number

GUI.DrawMessageBoxesOnly(spriteBatch)

DrawMessageBoxesOnly

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

GUI.DrawProgressBar(sb, start, size, progress, clr, outlineColor, depth)

DrawProgressBar

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • progress number

  • clr Microsoft.Xna.Framework.Color

  • outlineColor Microsoft.Xna.Framework.Color

  • depth number

GUI.DrawProgressBar(sb, start, size, progress, clr, depth)

DrawProgressBar

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • progress number

  • clr Microsoft.Xna.Framework.Color

  • depth number

GUI.DrawRectangle(sb, corners, clr, depth, thickness)

DrawRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • corners Microsoft.Xna.Framework.Vector2[]

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • thickness number

GUI.DrawRectangle(sb, center, width, height, rotation, clr, depth, thickness)

DrawRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • center Microsoft.Xna.Framework.Vector2

  • width number

  • height number

  • rotation number

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • thickness number

GUI.DrawRectangle(sb, position, size, origin, rotation, clr, depth, thickness, outlinePos)

DrawRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • position Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • origin Microsoft.Xna.Framework.Vector2

  • rotation number

  • clr Microsoft.Xna.Framework.Color

  • depth number

  • thickness number

  • outlinePos OutlinePosition

GUI.DrawRectangle(sb, rect, clr, isFilled, depth, thickness)

DrawRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • rect Microsoft.Xna.Framework.Rectangle

  • clr Microsoft.Xna.Framework.Color

  • isFilled bool

  • depth number

  • thickness number

GUI.DrawRectangle(sb, start, size, clr, isFilled, depth, thickness)

DrawRectangle

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • start Microsoft.Xna.Framework.Vector2

  • size Microsoft.Xna.Framework.Vector2

  • clr Microsoft.Xna.Framework.Color

  • isFilled bool

  • depth number

  • thickness number

GUI.DrawSineWithDots(spriteBatch, from, dir, amplitude, length, scale, pointCount, color, dotSize)

DrawSineWithDots

Parameters

  • spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch

  • from Microsoft.Xna.Framework.Vector2

  • dir Microsoft.Xna.Framework.Vector2

  • amplitude number

  • length number

  • scale number

  • pointCount number

  • color Microsoft.Xna.Framework.Color

  • dotSize number

GUI.DrawString(sb, pos, text, color, backgroundColor, backgroundPadding, font, forceUpperCase)

DrawString

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • pos Microsoft.Xna.Framework.Vector2

  • text LocalizedString

  • color Microsoft.Xna.Framework.Color

  • backgroundColor optional Microsoft.Xna.Framework.Color

  • backgroundPadding number

  • font GUIFont

  • forceUpperCase ForceUpperCase

GUI.DrawString(sb, pos, text, color, backgroundColor, backgroundPadding, font, forceUpperCase)

DrawString

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • pos Microsoft.Xna.Framework.Vector2

  • color Microsoft.Xna.Framework.Color

  • backgroundColor optional Microsoft.Xna.Framework.Color

  • backgroundPadding number

  • font GUIFont

  • forceUpperCase ForceUpperCase

GUI.DrawStringWithColors(sb, pos, text, color, richTextData, backgroundColor, backgroundPadding, font, depth)

DrawStringWithColors

Parameters

  • sb Microsoft.Xna.Framework.Graphics.SpriteBatch

  • pos Microsoft.Xna.Framework.Vector2

  • color Microsoft.Xna.Framework.Color

  • richTextData Nullable`1&

  • backgroundColor optional Microsoft.Xna.Framework.Color

  • backgroundPadding number

  • font GUIFont

  • depth number

GUI.ForceMouseOn(c)

ForceMouseOn

Parameters

  • c GUIComponent

GUI.GetAdditions()

GetAdditions

Returns

  • IEnumerable

GUI.HasSizeChanged(referenceResolution, referenceUIScale, referenceHUDScale)

HasSizeChanged

Parameters

  • referenceResolution Microsoft.Xna.Framework.Point

  • referenceUIScale number

  • referenceHUDScale number

Returns

  • bool

GUI.Init()

Init

GUI.IntScale(f)

IntScale

Parameters

  • f number

Returns

  • number

GUI.IntScaleCeiling(f)

IntScaleCeiling

Parameters

  • f number

Returns

  • number

GUI.IntScaleFloor(f)

IntScaleFloor

Parameters

  • f number

Returns

  • number

GUI.IsFourByThree()

IsFourByThree

Returns

  • bool

GUI.IsMouseOn(target)

IsMouseOn

Parameters

  • target GUIComponent

Returns

  • bool

GUI.NotifyPrompt(header, body)

NotifyPrompt

Parameters

  • header LocalizedString

  • body LocalizedString

GUI.PreventElementOverlap(elements, disallowedAreas, clampArea)

PreventElementOverlap

Parameters

  • elements IList

  • disallowedAreas IList

  • clampArea optional Microsoft.Xna.Framework.Rectangle

GUI.PromptTextInput(header, body, onConfirm)

PromptTextInput

Parameters

  • header LocalizedString

  • onConfirm Action

Returns

  • GUIMessageBox

GUI.RemoveFromUpdateList(component, alsoChildren)

RemoveFromUpdateList

Parameters

  • component GUIComponent

  • alsoChildren bool

GUI.SetCursorWaiting(waitSeconds, endCondition)

SetCursorWaiting

Parameters

  • waitSeconds number

  • endCondition Func

GUI.SetSavingIndicatorState(enabled)

SetSavingIndicatorState

Parameters

  • enabled bool

GUI.TogglePauseMenu()

TogglePauseMenu

GUI.Update(deltaTime)

Update

Parameters

  • deltaTime number

GUI.UpdateGUIMessageBoxesOnly(deltaTime)

UpdateGUIMessageBoxesOnly

Parameters

  • deltaTime number

GUI.UpdateMouseOn()

UpdateMouseOn

Returns

  • GUIComponent

GetHashCode()

GetHashCode

Returns

  • number

GetType()

GetType

Returns

  • Type

ToString()

ToString

Returns

Fields

GUI.Arrow

GUI.Arrow, field of type Sprite

GUI.AspectRatioAdjustment

GUI.AspectRatioAdjustment, field of type number

GUI.Canvas

GUI.Canvas, field of type GUICanvas

GUI.ColorComponentLabels

GUI.ColorComponentLabels, field of type String[]

GUI.DisableCharacterNames

GUI.DisableCharacterNames, field of type bool

GUI.DisableHUD

GUI.DisableHUD, field of type bool

GUI.DisableItemHighlights

GUI.DisableItemHighlights, field of type bool

GUI.DisableUpperHUD

GUI.DisableUpperHUD, field of type bool

GUI.GraphicsDevice

GUI.GraphicsDevice, field of type Microsoft.Xna.Framework.Graphics.GraphicsDevice

GUI.HideCursor

GUI.HideCursor, field of type bool

GUI.HorizontalAspectRatio

GUI.HorizontalAspectRatio, field of type number

GUI.InputBlockingMenuOpen

GUI.InputBlockingMenuOpen, field of type bool

GUI.IsUltrawide

GUI.IsUltrawide, field of type bool

GUI.KeyboardDispatcher

GUI.KeyboardDispatcher, field of type EventInput.KeyboardDispatcher

GUI.MouseCursor

GUI.MouseCursor, field of type CursorState

GUI.MouseOn

GUI.MouseOn, field of type GUIComponent

GUI.PauseMenu

GUI.PauseMenu, field of type GUIFrame

GUI.PauseMenuOpen

GUI.PauseMenuOpen, field of type bool

GUI.PreventPauseMenuToggle

GUI.PreventPauseMenuToggle, field of type bool

GUI.RectComponentLabels

GUI.RectComponentLabels, field of type String[]

GUI.ReferenceResolution

GUI.ReferenceResolution, field of type Microsoft.Xna.Framework.Vector2

GUI.RelativeHorizontalAspectRatio

GUI.RelativeHorizontalAspectRatio, field of type number

GUI.RelativeVerticalAspectRatio

GUI.RelativeVerticalAspectRatio, field of type number

GUI.SamplerState

GUI.SamplerState, field of type Microsoft.Xna.Framework.Graphics.SamplerState

GUI.SamplerStateClamp

GUI.SamplerStateClamp, field of type Microsoft.Xna.Framework.Graphics.SamplerState

GUI.Scale

GUI.Scale, field of type number

GUI.ScreenChanged

GUI.ScreenChanged, field of type bool

GUI.ScreenOverlayColor

GUI.ScreenOverlayColor, field of type Microsoft.Xna.Framework.Color

GUI.SettingsMenuContainer

GUI.SettingsMenuContainer, field of type GUIFrame

GUI.SettingsMenuOpen

GUI.SettingsMenuOpen, field of type bool

GUI.SlicedSpriteScale

GUI.SlicedSpriteScale, field of type number

GUI.UIWidth

GUI.UIWidth, field of type number

GUI.VectorComponentLabels

GUI.VectorComponentLabels, field of type String[]

GUI.VerticalAspectRatio

GUI.VerticalAspectRatio, field of type number

GUI.WhiteTexture

GUI.WhiteTexture, field of type Microsoft.Xna.Framework.Graphics.Texture2D

GUI.xScale

GUI.xScale, field of type number

GUI.yScale

GUI.yScale, field of type number