Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGui Windows being weird #7460

Closed
GamingBonejon opened this issue Apr 1, 2024 · 1 comment
Closed

ImGui Windows being weird #7460

GamingBonejon opened this issue Apr 1, 2024 · 1 comment

Comments

@GamingBonejon
Copy link

Version/Branch of Dear ImGui:

Version 1.90.1.1, Branch: XXX (master/docking/etc.)

Back-ends:

imgui_impl_XXX.cpp + imgui_impl_XXX.cpp

Compiler, OS:

Win 11

Full config/build information:

No response

Details:

image_2024-03-31_173210395
That black box is 1920x1080 but it doesn't fit my entire screen, All the windows I move over the sides where the black box ends act like its a screen border. How do I fix? I'm completely stumped, It worked the first time I used it (Diff project) but now it never works properly and does this.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

I am specifically dealing with the DrawOverlay() function but the same issue applies to my other window. This script gets called with

Renderer rendering = new Renderer();
rendering.Start().Wait();
rendering.SetPath(replacedFP, sSize);

from program.cs


namespace CSGUIHek
{
internal class Renderer : Overlay
{
public Vector2 wSize = new Vector2(300, 300);
public Vector2 center = new Vector2(0,0);
public Vector2 sSize = new Vector2(0, 0);

    bool aim = false;
    float smoothing = 0f;
    float fov = 0f;

    string FilePath;
    protected override void Render()
    {
        ImGui.SetNextWindowSize(wSize);
        ImGui.Begin("Ekknod CS2 GUI");
        ImGui.Checkbox("Enable Aim", ref aim);
        if (aim) 
        { 
            ImGui.SliderFloat("Smoothing", ref smoothing, 0, 10); 
            ImGui.SliderFloat("FOV", ref fov, 0, 50);        
        }

        DrawOverlay(sSize);
    }

    public void SetPath(string path, Vector2 size) 
    { 
        FilePath = path;
        center = size/2;
        sSize = size;
    }

    public static void Main()
    {
    }

    void DrawOverlay(Vector2 sSize)
    {
        Console.WriteLine(sSize);
        ImGui.SetNextWindowSize(sSize);
        ImGui.SetNextWindowPos(new Vector2(0,0));
        ImGui.Begin("Overlay", ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoBringToFrontOnFocus | ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse);

        uint whiteColor = ImGui.GetColorU32(new Vector4(1.0f, 1.0f, 1.0f, 1.0f));
        Console.WriteLine(center);
        ImGui.GetWindowDrawList().AddCircle(new Vector2(0,0), 30, whiteColor, num_segments: 32);
        ImGui.GetWindowDrawList().AddLine(new Vector2(0,0), new Vector2(300,300), whiteColor);
    }
}

}

@ocornut
Copy link
Owner

ocornut commented Apr 2, 2024

Sorry but #1586

@ocornut ocornut closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants