ImGuiRenderer Class
Definition
Section titled “Definition”public class ImGuiRendererInheritance object
Properties
Section titled “Properties”WantsMouseCapture
Section titled “WantsMouseCapture”When true, indicates thats the ImGui input system is going to use the mouse, for example when the mouse is over a UI element; otherwise false.
public bool WantsMouseCapture { get; }WantsKeyboardCapture
Section titled “WantsKeyboardCapture”When true, indicates thats the ImGui input system is going to use the mouse, for example when focus is on a textbox; otherwise false.
public bool WantsKeyboardCapture { get; }HideRequested
Section titled “HideRequested”When true, indicates thats the UI should be hidden and stopped. Once it’s hidden and stopped, this property is set to false.
public bool HideRequested { get; set; }Methods
Section titled “Methods”RebuildFontAtlas()
Section titled “RebuildFontAtlas()”Creates a texture and loads the font data from ImGui. Should be called when the Microsoft.Xna.Framework.Graphics.GraphicsDevice is initialized but before any rendering is done
public virtual void RebuildFontAtlas()BindTexture(Texture2D)
Section titled “BindTexture(Texture2D)”Creates a pointer to a texture, which can be passed through ImGui calls such as Image(ImTextureID, Vector2, Vector2, Vector2, Vector4, Vector4). That pointer is then used by ImGui to let us know what texture to draw
public virtual ImTextureID BindTexture(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
Returns
Section titled “Returns”Hexa.NET.ImGui.ImTextureID
UnbindTexture(ImTextureID)
Section titled “UnbindTexture(ImTextureID)”Removes a previously created texture pointer, releasing its reference and allowing it to be deallocated
public virtual void UnbindTexture(ImTextureID textureId)Parameters
Section titled “Parameters”textureId Hexa.NET.ImGui.ImTextureID
UnbindTexture(Texture2D)
Section titled “UnbindTexture(Texture2D)”Removes a previously created texture pointer, releasing its reference and allowing it to be deallocated
public virtual void UnbindTexture(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
BeforeLayoutInput(GameTime)
Section titled “BeforeLayoutInput(GameTime)”Runs the ImGui input. Call before BeforeLayout(GameTime).
public void BeforeLayoutInput(GameTime gameTime)Parameters
Section titled “Parameters”gameTime Microsoft.Xna.Framework.GameTime
Game frame delta.
BeforeLayout(GameTime)
Section titled “BeforeLayout(GameTime)”Sets up ImGui for a new frame, should be called at frame start
public virtual void BeforeLayout(GameTime gameTime)Parameters
Section titled “Parameters”gameTime Microsoft.Xna.Framework.GameTime
AfterLayout()
Section titled “AfterLayout()”Asks ImGui for the generated geometry data and sends it to the graphics pipeline, should be called after the UI is drawn using ImGui.** calls
public virtual void AfterLayout()SetupInput()
Section titled “SetupInput()”Setup key input event handler.
protected virtual void SetupInput()UpdateEffect(Texture2D)
Section titled “UpdateEffect(Texture2D)”Updates the Microsoft.Xna.Framework.Graphics.Effect to the current matrices and texture
protected virtual Effect UpdateEffect(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
Returns
Section titled “Returns”Microsoft.Xna.Framework.Graphics.Effect
UpdateInput()
Section titled “UpdateInput()”Sends XNA input state to ImGui
protected virtual void UpdateInput()AddFontTTF(string, float)
Section titled “AddFontTTF(string, float)”public ImFontPtr AddFontTTF(string file, float size)Parameters
Section titled “Parameters”file string
size float
Returns
Section titled “Returns”Hexa.NET.ImGui.ImFontPtr
SetDefaultFont(ImFontPtr)
Section titled “SetDefaultFont(ImFontPtr)”public void SetDefaultFont(ImFontPtr value)Parameters
Section titled “Parameters”value Hexa.NET.ImGui.ImFontPtr
HasBoundTexture(Texture2D)
Section titled “HasBoundTexture(Texture2D)”public bool HasBoundTexture(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
Returns
Section titled “Returns”GetBoundTexturePointer(Texture2D)
Section titled “GetBoundTexturePointer(Texture2D)”public ImTextureID GetBoundTexturePointer(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
Returns
Section titled “Returns”Hexa.NET.ImGui.ImTextureID
ReplaceBoundTexture(ImTextureID, Texture2D)
Section titled “ReplaceBoundTexture(ImTextureID, Texture2D)”public void ReplaceBoundTexture(ImTextureID textureID, Texture2D texture)Parameters
Section titled “Parameters”textureID Hexa.NET.ImGui.ImTextureID
texture Microsoft.Xna.Framework.Graphics.Texture2D