Show / Hide Table of Contents

Class GUIManager

Manager for handling anything GUI related. Provides Valheim style GUI elements as well as an anchor for custom GUI prefabs.
Inheritance
object
GUIManager
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public class GUIManager

Fields

Name Description
UILayer Unity layer constant for UI objects.
ValheimBeige The default Valheim beige color.
ValheimButtonColorBlock Button color block in Valheim style
ValheimControlResources DefaultControls.Resources with default Valheim assets.
ValheimOrange The default Valheim orange color.
ValheimScrollbarHandleColorBlock Scrollbar handle color block in default Valheim orange.
ValheimToggleColorBlock Toggle color block in Valheim style.
ValheimYellow The default Valheim yellow color.

Properties

Name Description
AveriaSerif Valheim's standard font, normal faced.
AveriaSerifBold Valheim's standard font, bold faced.
CustomGUIBack GUI container behind Valheim's GUI elements with automatic scaling for high res displays and pixel correction. Gets rebuild at every scene change so make sure to add your custom GUI prefabs again on each scene change.
CustomGUIFront GUI container in front of Valheim's GUI elements with automatic scaling for high res displays and pixel correction. Gets rebuild at every scene change so make sure to add your custom GUI prefabs again on each scene change.
Instance Singleton instance
Norse Valheim's rune-like font, normal faced.
NorseBold Valheim's rune-like font, bold faced.

Methods

Name Description
ApplyButtonStyle(Button, int) Apply valheim style to a UnityEngine.UI.Button Component
ApplyDropdownStyle(Dropdown, int) Apply Valheim style to a Dropdown component.
ApplyInputFieldStyle(InputField, int) Apply Valheim style to an InputField Component.
ApplyScrollRectStyle(ScrollRect) Apply Valheim style to a ScrollRect component.
ApplyScrollbarStyle(Scrollbar) Apply Valheim style to a Scrollbar component.
ApplySliderStyle(Slider) Apply Valheim style to a Slider component.
ApplySliderStyle(Slider, Vector2) Apply Valheim style to a Slider component.
ApplyTextStyle(Text, Color, int, bool) Apply Valheim style to a Text Component. Uses
GUIManager.Instance.AveriaSerifBold
by default
ApplyTextStyle(Text, Font, Color, int, bool) Apply Valheim style to a Text Component
ApplyTextStyle(Text, int) Apply Valheim style to a Text Component. Uses
GUIManager.Instance.AveriaSerifBold
,
Color.white
and creates an outline by default
ApplyToogleStyle(Toggle) Apply Valheim style to a UnityEngine.UI.Toggle component.
ApplyWoodpanelStyle(Transform) Apply Valheim style to a woodpanel.
BlockInput(bool) Block all input except GUI
CreateButton(string, Transform, Vector2, Vector2, Vector2, float, float) Create a new button (Valheim style).
CreateColorPicker(Vector2, Vector2, Vector2, Color, string, ColorEvent, ColorEvent, bool) Creates and displays a Valheim style ColorPicker
CreateDropDown(Transform, Vector2, Vector2, Vector2, int, float, float) Create dropdown field
CreateGradientPicker(Vector2, Vector2, Vector2, Gradient, string, GradientEvent, GradientEvent) Creates and displays a Valheim style GradientPicker
CreateInputField(Transform, Vector2, Vector2, Vector2, ContentType, string, int, float, float) Create a new InputField (Valheim style).
CreateKeyBindField(string, Transform, float, float) Create key binding field
CreateScrollView(Transform, bool, bool, float, float, ColorBlock, Color, float, float) Create a complete scroll view
CreateText(string, Transform, Vector2, Vector2, Vector2, Font, int, Color, bool, Color, float, float, bool) Create a GameObject with a Text (and optional Outline and ContentSizeFitter) component
CreateToggle(Transform, float, float) Create toggle field
CreateWoodpanel(Transform, Vector2, Vector2, Vector2, float, float) Creates a Valheim style woodpanel which is draggable per default
CreateWoodpanel(Transform, Vector2, Vector2, Vector2, float, float, bool) Creates a Valheim style woodpanel, can optionally be draggable
GetSprite(string) Get a sprite by name.
IsHeadless() Detect headless mode (aka dedicated server)

Events

Name Description
OnCustomGUIAvailable Event that gets fired every time the Unity scene changed and new CustomGUI objects were created. Subscribe to this event to create your custom GUI objects and add them as a child to either CustomGUIFront or CustomGUIBack.

Extension Methods

PrefabExtension.FixReferences(object)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾