Skip to content

Add VisualTimer, ResourceOrb, Toast and HUDBar extensions - #2378

Merged
4ian merged 8 commits into
mainfrom
claude/dreamy-mendel-iw5mn6
Nov 26, 2026
Merged

4ian merged 8 commits into
mainfrom
claude/dreamy-mendel-iw5mn6

Conversation

@4ian

@4ian 4ian commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Description

Four new ready-to-use custom objects for game interfaces. Their events contain no JavaScript, except a one-line condition in Toast that detects the in-game editor.

  • VisualTimer: a countdown or a stopwatch shown on screen, with a background, an icon and the time. The text turns to a warning style and blinks during the last seconds of a countdown.
    • Properties: Mode (countdown or stopwatch), Duration, TimeFormat (1:05, 65, 65.0 or 0:01:05), ShouldStartOnCreation, WarningDuration, SceneTimerName.
    • Actions and conditions: Start, Pause, Restart, Add time, Is running, Countdown is finished, Countdown has just finished (true for one frame), Time left, Elapsed time (expression, condition and action), Countdown duration.
    • Scene timers: when SceneTimerName is set, the object shows that scene timer instead of counting by itself. Start, Pause and Restart also unpause, pause and reset the scene timer, so the timer used by the game rules and the time on screen stay the same.
    • Object timers: use the "Elapsed time" action with Player.ObjectTimerElapsedTime("Shield") every frame.
  • ResourceOrb: a round gauge filled with a liquid, for health, mana or stamina. The liquid level eases to new values, and the previous level stays visible for a moment as a lighter buffer. It can show a "value/max" label.
    • Properties: MaxValue, InitialValue, ShowLabel, EasingDuration, PreviousHighValueDuration.
    • Value and maximum value (expression, condition and action), Is empty, Is full.
    • The liquid is a tiled sprite cropped from its top, so the texture is not stretched. The orb scales as a whole.
  • Toast: a notification that slides in and fades in, stays a few seconds, then leaves. Its kind (info, success, warning or error) picks the icon.
    • Properties: TitleText, MessageText, Kind, ShouldShowOnCreation, DisplayDuration (0 to keep it shown), AnimationDuration, SlideDistance.
    • Actions and conditions: Show a toast (title, message and kind), Show, Hide, Is shown. A toast asked for while another one is shown waits for it to leave.
  • HUDBar: a bar across the top of the screen, made of existing custom objects: lives (TiledUnitsBar), score and coins (ScoreCounter), and a pause button (PanelSpriteButton). The parts are anchored, so the bar can be resized to the width of the screen.
    • Properties: LivesValue, MaxLives, ScoreValue, CoinsValue, and ShowLives, ShowScore, ShowCoins, ShowPauseButton.
    • Lives, Maximum lives, Score, Coins (expression, condition and action), Has no lives left, Pause button is clicked.

Each object was tested in a scene run by the GDevelop CLI, which drove the actions and checked the expressions and the children:

  • the countdown, the stopwatch and the scene timer;
  • adding time after the end of a countdown;
  • the easing and buffer of the orb;
  • the toast queue and the toast's position;
  • the lives, score and coins of the HUD bar.

How to use it

Drag one of the objects from the asset store, in one of the 15 styles of GDevelop-assets (assets in GDevelopApp/GDevelop-assets, branch claude/dreamy-mendel-iw5mn6-hud-objects, to merge after this PR):

HUD objects in several styles

Then for example:

  • Timer: at the beginning of the scene, use "Start" on the timer. When "Countdown has just finished", go to the game over scene.
  • Orb: when the player is hit, change the orb's value: subtract 10.
  • Toast: when a chest is opened, use "Show a toast" with the title "Treasure found", the message "+50 coins" and the kind "Success".
  • HUD bar: set its score and coins when they change. When "Pause button is clicked", pause the game.

Example project

No example project is attached. The assets PR has a variant of each object in 15 styles.

Checklist

  • I've followed all of the best practices. The checks of this pull request must pass.
  • New extensions are added to extensions/community/.
  • The example project is the whole folder of my project, not a build of my game.
  • The example project is attached as a ZIP file, not linked to an external service like Google Drive.
  • I've considered adding my extension to the GDevelop community list, but think it's better to have it here.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

AI usage

  • I used an AI to generate some part of the code.
  • I don't understand the generated code or I don't feel able to modify it.

Generated by Claude Code

- Dialogs: an info dialog with a button and an optional close button, and a
  dialog with up to 5 choices (like a pause menu). Hidden empty choices, a
  selector following the focused choice, mouse, touch, keyboard and gamepad.
- Area title: the name of an area or a level with a subtitle, shown with a
  fade when the player enters it.

Made only with events.
…o claude/dreamy-mendel-iw5mn6

# Conflicts:
#	extensions/community/Dialogs.json
@4ian
4ian requested a review from a team as a code owner November 26, 2026 18:08
@4ian
4ian merged commit 40a3d76 into main Nov 26, 2026
5 checks passed
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