Class UiBuilder
This class represents the Dalamud UI that is drawn on top of the game. It can be used to draw custom windows and overlays.
Inheritance
Implements
Inherited Members
Namespace: Dalamud.Interface
Assembly: Dalamud.dll
Syntax
public class UiBuilder : IDisposable
Properties
| Improve this Doc View SourceDefaultFont
Gets the default Dalamud font based on Noto Sans CJK Medium in 17pt - supporting all game languages and icons.
Declaration
public static ImFontPtr DefaultFont { get; }
Property Value
| Type | Description |
|---|---|
| ImFontPtr |
Device
Gets the game's active Direct3D device.
Declaration
public Device Device { get; }
Property Value
| Type | Description |
|---|---|
| SharpDX.Direct3D11.Device |
DisableAutomaticUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically when the game's UI is hidden.
Declaration
public bool DisableAutomaticUiHide { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DisableCutsceneUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically during cutscenes.
Declaration
public bool DisableCutsceneUiHide { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DisableGposeUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically while gpose is active.
Declaration
public bool DisableGposeUiHide { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
DisableUserUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically when the user toggles the UI.
Declaration
public bool DisableUserUiHide { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IconFont
Gets the default Dalamud icon font based on FontAwesome 5 Free solid in 17pt.
Declaration
public static ImFontPtr IconFont { get; }
Property Value
| Type | Description |
|---|---|
| ImFontPtr |
OnBuildFonts
Gets or sets an action that is called any time ImGui fonts need to be rebuilt.
Any ImFontPtr objects that you store can be invalidated when fonts are rebuilt
(at any time), so you should both reload your custom fonts and restore those
pointers inside this handler.
PLEASE remove this handler inside Dispose, or when you no longer need your fonts!
Declaration
public Action OnBuildFonts { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Action |
WindowHandlePtr
Gets the game's main window handle.
Declaration
public IntPtr WindowHandlePtr { get; }
Property Value
| Type | Description |
|---|---|
| System.IntPtr |
Methods
| Improve this Doc View SourceDispose()
Unregister the UiBuilder. Do not call this in plugin code.
Declaration
public void Dispose()
LoadImage(Byte[])
Loads an image from a byte stream, such as a png downloaded into memory.
Declaration
public TextureWrap LoadImage(byte[] imageData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | imageData | A byte array containing the raw image data. |
Returns
| Type | Description |
|---|---|
| TextureWrap | A TextureWrap object wrapping the created image. Use ImGuiHandle inside ImGui.Image(). |
LoadImage(String)
Loads an image from the specified file.
Declaration
public TextureWrap LoadImage(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The full filepath to the image. |
Returns
| Type | Description |
|---|---|
| TextureWrap | A TextureWrap object wrapping the created image. Use ImGuiHandle inside ImGui.Image(). |
LoadImageRaw(Byte[], Int32, Int32, Int32)
Loads an image from raw unformatted pixel data, with no type or header information. To load formatted data, use LoadImage(Byte[]).
Declaration
public TextureWrap LoadImageRaw(byte[] imageData, int width, int height, int numChannels)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | imageData | A byte array containing the raw pixel data. |
| System.Int32 | width | The width of the image contained in |
| System.Int32 | height | The height of the image contained in |
| System.Int32 | numChannels | The number of channels (bytes per pixel) of the image contained in |
Returns
| Type | Description |
|---|---|
| TextureWrap | A TextureWrap object wrapping the created image. Use ImGuiHandle inside ImGui.Image(). |
RebuildFonts()
Call this to queue a rebuild of the font atlas.
This will invoke any OnBuildFonts handlers and ensure that any loaded fonts are
ready to be used on the next UI frame.
Declaration
public void RebuildFonts()
Events
| Improve this Doc View SourceOnBuildUi
The delegate that gets called when Dalamud is ready to draw your windows or overlays. When it is called, you can use static ImGui calls.
Declaration
public event RawDX11Scene.BuildUIDelegate OnBuildUi
Event Type
| Type | Description |
|---|---|
| RawDX11Scene.BuildUIDelegate |
OnOpenConfigUi
Event that is fired when the plugin should open its configuration interface.
Declaration
public event EventHandler OnOpenConfigUi
Event Type
| Type | Description |
|---|---|
| System.EventHandler |