Skip to content

debugui: consider removing Popup functions #25

Open

Description

@hajimehoshi

I'm now dogfooding debugui at the Ebitengine examples. If I fail to find use cases of popups, I'll consider removing them.

Activity

  1. added this to the v0.1.0 milestone on Mar 23, 2025
  2. ShadyHippo commented on Mar 25, 2025

    @ShadyHippo
    Contributor

    I'm making a level editor for my game with debugUI. It is working very well so far.

    I haven't used popups yet but popup is one of the options for a right click menu for my entities while I'm in the edit level state. Otherwise I'll have to open a new window when I right click. I haven't tested it yet.

    I will do that next to see which I prefer and let you know how the use case goes

  3. removed this from the v0.1.0 milestone on Apr 5, 2025
  4. hajimehoshi commented on Apr 5, 2025

    @hajimehoshi
    MemberAuthor

    I removed the milestone. Let's revisit this later.

  5. ShadyHippo commented on Apr 6, 2025

    @ShadyHippo
    Contributor

    Sorry for the slow response from me, I finally got time tonight to try it out.

    My work with ebiten and golang and debug UI is all my hobby, it is not my day job so if I am too slow to get to something please don't let me halt your progress.

    The popups work very conveniently to open and have buttons for the "menu". The only issue is that they do not close on button click. I thought this would be easy to fix by writing a simple close method like this:

    func (c *Context) OpenPopup(name string) {
    	cnt := c.Container(name)
    	// set as hover root so popup isn't closed in begin_window_ex()
    	c.nextHoverRoot = cnt
    	c.hoverRoot = c.nextHoverRoot
    	// position at mouse cursor, open and bring-to-front
    	cnt.layout.Rect = image.Rect(c.mousePos.X, c.mousePos.Y, c.mousePos.X+1, c.mousePos.Y+1)
    	cnt.open = true
    	c.bringToFront(cnt)
    }
    
    func (c *Context) ClosePopup(name string) {
    	cnt := c.Container(name)
    	cnt.open = false
    }

    And calling it in my button if statement but for reasons I don't yet understand this was not sufficient. When I get some more time I may experiment more but I think this feature is worth keeping around if it is simple to maintain because right mouse click menus are very common use cases in editors.

    Another nice use of the popup is to popup a window when you click an element or entity while holding a key like Ctrl or Alt and have it populated with that entities state information like a debugger does on hover in IDEs.

    In the end I do think the popup is worth keeping. Thank you for considering my input!

  6. hajimehoshi commented on Apr 6, 2025

    @hajimehoshi
    MemberAuthor

    I thought this would be easy to fix by writing a simple close method like this:

    Hmm? Please check the latest API. There is already ClosePopup.

  7. hajimehoshi commented on Apr 6, 2025

    @hajimehoshi
    MemberAuthor

    So, are you using popups in your actual code?

  8. ShadyHippo commented on Apr 6, 2025

    @ShadyHippo
    Contributor

    I'm very far behind in my fork because when I pulled last there were breaking changes. I think last time the example wasn't update yet. I will pull and try again. Thank you!

  9. ShadyHippo commented on Apr 6, 2025

    @ShadyHippo
    Contributor

    Just tried it, yes - this is exactly what I need! Thank you!!

  10. ShadyHippo commented on Apr 6, 2025

    @ShadyHippo
    Contributor

    So, are you using popups in your actual code?

    I will be now. I need to update to the new API changes but once I do I will be using it for a right click menu

  11. Vmarcelo49 commented on Jun 14, 2025

    @Vmarcelo49
    Contributor

    I am also using the popups, since it seems that debugui doesnt have a dropdown/combo menu i use them to make an expandable list of my game objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions