Comments (18)
i fixed it
from imgui.net.
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.
I tried that but I get this error when I run it.
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.
Make sure you are using the latest version of imgui.net. We fixed this bug few months ago.
from imgui.net.
I was using an outdated version, im testing it rn.
from imgui.net.
i get this error when i updated to the latest release (im using .net 6.0)
from imgui.net.
Only
works for me without crashing
from imgui.net.
You don’t need vsync feature of that library, just remove that if condition.
from imgui.net.
I removed that line and i get that (thats not my code thats the actual im gui .net code)
from imgui.net.
from imgui.net.
Do you have a discord? Can I add you on their and you can help me easily?
from imgui.net.
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.
Can I just send you a simple project that does the same thing?
from imgui.net.
Can I add you on discord so you can help me easier?
from imgui.net.
my discord is: metal_developer
from imgui.net.
💀 you helped me then just said good luck when it created a problem
from imgui.net.
I knew you would be able to fix it yourself, good stuff! Closing the issue.
from imgui.net.
how did you fix it? i cannot for the life of me get fonts working
from imgui.net.
Related Issues (20)
- Is there a way to debug unbalanced ImGUI calls? Expecting IM_ASSERT_USER_ERROR but instead get silence HOT 3
- Access Violation With using ImGui.Begin HOT 2
- ImGui.PushStyleVar passes incorrect Y value for ImGuiStyleVar.WindowMinSize since version 1.90.0.0 HOT 5
- End of netstandard2.0 support
- ImGuiController problem HOT 1
- Problem merging font awesome into default font HOT 4
- Popups HOT 1
- Bad code gen for SlideInt2(), etc. HOT 2
- imgui.net is missing NuGet package README file
- Scaled fonts are low quality HOT 1
- Gamepad navigation does not work HOT 3
- CustomWidget sliders share the same value HOT 4
- Custom rendering examle HOT 1
- Add ReadOnlySpan<byte> overloads for string parameters HOT 1
- ImGui not showing on my whole screen HOT 1
- file dialog
- "How to display UTF-8 encoded text using ImGui.NET in C#" HOT 5
- Adding some sort of installable error handler / callback for improved diagnostics. HOT 5
- Input is active in Monogame when the application doesn't have focus HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.net.