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

Getting a stable Id of item #2905

Closed
pixtur opened this issue Nov 24, 2019 · 1 comment
Closed

Getting a stable Id of item #2905

pixtur opened this issue Nov 24, 2019 · 1 comment

Comments

@pixtur
Copy link

pixtur commented Nov 24, 2019

Version/Branch of Dear ImGui:

Version: 1.70
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui.net
Operating System: win10

My Issue/Question:
I want to implement a custom DragFloat compoment. I believe for this I need an item-identifier for that is stable between frames. Is there an API to access the id the of last item? I searched in imgui.h but couldn't find anything.

in issue #1537 i found the following code:

    if (g.LastActiveId == g.CurrentWindow->GetID(str_id))// && g.LastActiveIdTimer < ANIM_SPEED)
    {
        float t_anim = ImSaturate(g.LastActiveIdTimer / ANIM_SPEED);
        t = *v ? (t_anim) : (1.0f - t_anim);
    }

But I believe that this is not exposed on the default API. Since I using imgui.net I only have access to the main API.

@pixtur
Copy link
Author

pixtur commented Nov 24, 2019

After re-reading the imgui.h, I realized, that GetID(string) is just the method, I was looking for. I guess I got confused by the string parameter.

@pixtur pixtur closed this as completed Nov 24, 2019
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

1 participant