public override void Init(ImGuiIOPtr io) { // instead of calling base.Init(io) to setup the font, we'll do it ourselves // add font directly from the filesystem, not a resource io.Fonts.AddFontFromFileTTF("Hack-Regular.ttf", 16); io.Fonts.AddFontDefault(); // just for comparison ImGuiGD.RebuildFontAtlas(); }
public override void _Ready() { // connect the signal in code or in the editor // GetNode<ImGuiNode>("/root/Control/ImGui").Connect("IGLayout", this, nameof(_onLayout)); iconTexture = GD.Load <Texture>("res://icon.png"); iconTextureId = ImGuiGD.BindTexture(iconTexture); filter = (iconTexture.Flags & (uint)Texture.FlagsEnum.Filter) != 0; iconSize = (int)iconTexture.GetSize().x; ImGui.GetIO().ConfigFlags |= ImGuiConfigFlags.NavEnableGamepad; }
public override void _ExitTree() { ImGuiGD.UnbindTexture(iconTextureId); }