Skip to content

Add the Interface playground example: up to 40 nested dialogs - #1139

Draft
4ian wants to merge 4 commits into
mainfrom
claude/dreamy-mendel-iw5mn6-interface-playground
Draft

4ian wants to merge 4 commits into
mainfrom
claude/dreamy-mendel-iw5mn6-interface-playground

Conversation

@4ian

@4ian 4ian commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

A playground to stress the "Interface element" behavior of 4ian/GDevelop#9426, using the extensions of GDevelopApp/GDevelop-extensions#2388. To merge once GDevelop ships the behavior and the extensions are updated.

What's in the scene

  • Dialogs: up to 40 dialogs opened above each other, of 5 kinds, each in a different style:
    • info dialog (Jelly Pop),
    • choices dialog (Woodland), whose choices open more dialogs above it,
    • confirmation (Ironbound),
    • list shop (Toybox),
    • grid shop (Hologram).
  • Under the dialogs: a HUD (buttons, a slider) and a world (targets to click, a ball to drag).
  • Overlay: a full-screen object with the behavior, just under the dialog on top. O toggles it.

[Nested dialogs](https://github.com/GDevelopApp/GDevelop-examples/blob/claude/dreamy-mendel-iw5mn6-interface-playground/examples/interface-playground/preview.png?raw=true)

The events stay short. They open dialogs (one "for each" creates every kind, each above the others) and delete them when closed, and they place the overlay. Nothing handles the focus: the panels of the dialogs have the behavior. The world uses "The cursor/touch is on an object", which ignores the covered parts by default for new events. The cursor ring uses the new condition "The cursor/touch is on an object blocking the pointer".

Gameplay tests (7, all passing with GDevelop built from the engine PR)

  • The world and the HUD under a dialog ignore the pointer: targets aren't hit, and the cursor ring is hidden on the interface. With the overlay, nothing next to the dialog reacts either.
  • Only the dialog on top reacts to the pointer: a choice covered by the dialog above isn't clicked. Without the overlay, the uncovered choice of the lower dialog is clicked and closes only that dialog.
  • The keyboard and the gamepad go to the dialog on top, then back: only the focused dialog shows its selector. Escape and B close the top dialog only. The dialog under it gets the focus back with its choice kept. The gamepad is simulated.
  • Covered buttons, sliders and draggable objects don't react: HUD buttons under a shop, the ball under it (Draggable) and the slider under the overlay.
  • Deleting or hiding a dialog gives the focus to the right one: deleting the dialog in the middle of the stack keeps the focus on top. Hiding the top dialog gives the focus to the one under it. Showing it again gives the focus back.
  • Touches: the same checks with taps.
  • 40 nested dialogs: Escape closes them one by one, from the top. Profiled, see below.

40 nested dialogs

Performance (headless, software rendering, step time per frame)

with the behavior without it
No dialog 0.3 ms 0.6 ms
40 dialogs open, the cursor moving over them 27.2 ms 26.9 ms
Frame opening 40 dialogs at once 1.1 s 1.3 s

The behavior itself costs almost nothing: covering is only checked for the buttons under the pointer. The cost of 40 dialogs is their own per-frame events, mostly the 20 shops: their items, buttons and scrollbars.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Preview the game(s) changed or added in this Pull Request


This is an automatic message displaying links to the games in this PR - double check the JSON in case of doubt.

4ian and others added 2 commits November 29, 2026 16:37
- Replace IsCursorOnObject2 with IsCursorOnObject in scene events and embedded Shop/Scrollbar extensions.
- Enable focusParentCustomObject on the modal Panel children of embedded Dialogs and Shop variants.
…le masking) to the versions of the extensions pull request
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

Successfully merging this pull request may close these issues.

2 participants