Coder Social home page Coder Social logo

Comments (18)

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024 1

i fixed it

from imgui.net.

zaafar avatar zaafar commented on June 10, 2024

Font changing isn’t easy in this lib, sometime code is better than 1000 words so use this as reference: https://github.com/zaafar/ClickableTransparentOverlay/blob/master/Examples/SingleThreadedOverlayWithCoroutines/SampleOverlay.cs#L116

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

I tried that but I get this error when I run it.
image

Here is my code (My goal is to make a watermark that is displayed on the screen):

if (drawWatermark)
{
ImGui.SetNextWindowSize(screenSize);
ImGui.SetNextWindowPos(new Vector2(0, 0));
ImGui.Begin("Overlay", ImGuiWindowFlags.NoDecoration
| ImGuiWindowFlags.NoBackground
| ImGuiWindowFlags.NoBringToFrontOnFocus
| ImGuiWindowFlags.NoMove
| ImGuiWindowFlags.NoInputs
| ImGuiWindowFlags.NoCollapse
| ImGuiWindowFlags.NoScrollbar
| ImGuiWindowFlags.NoScrollWithMouse
);

   ImDrawListPtr drawList = ImGui.GetWindowDrawList();

   if ((DateTime.Now - _lastTime).TotalSeconds >= 2.25)
   {
       // one second has elapsed 

       _fps = _framesRendered;
       _framesRendered = 0;
       _lastTime = DateTime.Now;
   }






   this.ReplaceFont(@"C:\Windows\Fonts\msyh.ttc", 23, FontGlyphRangeType.English);
   font2 = null;

   //drawList.AddRectFilled(new Vector2(2, 5), new Vector2(120, 45), ImGui.ColorConvertFloat4ToU32(new Vector4(0.08f, 0.08f, 0.085f, 1f)), 6f);
   drawList.AddText(watermarkPos, ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 1f)), "MetalWare");
   drawList.AddText(fpsPos, ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 1f)), "FPS: " + _fps);


   if (font2 != null)
   {
       ImGui.PushFont(font2.Value);
   }

from imgui.net.

zaafar avatar zaafar commented on June 10, 2024

Make sure you are using the latest version of imgui.net. We fixed this bug few months ago.

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

I was using an outdated version, im testing it rn.

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

image
i get this error when i updated to the latest release (im using .net 6.0)

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

Only
image
works for me without crashing

from imgui.net.

zaafar avatar zaafar commented on June 10, 2024

You don’t need vsync feature of that library, just remove that if condition.

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

image
I removed that line and i get that (thats not my code thats the actual im gui .net code)

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

image
i also get this with it

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

Do you have a discord? Can I add you on their and you can help me easily?

from imgui.net.

zaafar avatar zaafar commented on June 10, 2024

How can I reproduce this issue on my side? For this purpose, I am wondering if u can give me the changes required to reproduce the issue in the sample projects (e.g. https://github.com/ImGuiNET/ImGui.NET/tree/master/src/ImGui.NET.SampleProgram OR https://github.com/zaafar/ClickableTransparentOverlay/tree/master/Examples)

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

Can I just send you a simple project that does the same thing?

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

Can I add you on discord so you can help me easier?

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

my discord is: metal_developer

from imgui.net.

MetalDeveloper avatar MetalDeveloper commented on June 10, 2024

💀 you helped me then just said good luck when it created a problem

from imgui.net.

zaafar avatar zaafar commented on June 10, 2024

I knew you would be able to fix it yourself, good stuff! Closing the issue.

from imgui.net.

Valshion007 avatar Valshion007 commented on June 10, 2024

how did you fix it? i cannot for the life of me get fonts working

from imgui.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.