Skip to content

New extension: Carousel - #2367

Open
NicolasDemangeat wants to merge 2 commits into
GDevelopApp:mainfrom
NicolasDemangeat:carousel
Open

NicolasDemangeat wants to merge 2 commits into
GDevelopApp:mainfrom
NicolasDemangeat:carousel

Conversation

@NicolasDemangeat

Copy link
Copy Markdown

Description

Adds a Carousel behavior that turns a sprite with several animations into a looping, sliding carousel item.

Calling Next or Previous:

  • smoothly tweens the current item off-screen,
  • switches to the next or previous animation index,
  • tweens the new item back into view.

Configurable properties (visible directly in the scene editor, per instance):

  • MinIndex / MaxIndex: the range of animation indexes to cycle through,
  • Loop: wrap around at the ends instead of stopping,
  • SlideDistance: how far the item slides off-screen,
  • Duration: how long each slide takes, in seconds (0.4 by default).

The Tween behavior is required and is added automatically when Carousel is added to an object. It also works well with the swipe gesture extension.

This replaces the old submission #2282 (closed when the submission process changed).

How to use it

Put the Carousel behavior on a sprite with multiple animations to build:

  • a level-select screen, cycling through level previews,
  • a character or skin picker,
  • any settings screen cycling through a small set of choices (difficulty, region, theme...).

Setup:

  1. Set MinIndex and MaxIndex to match the animations of your object (0-based: the first animation is index 0).
  2. Enable Loop if the carousel should wrap around at the ends.
  3. Call Next / Previous from your arrow buttons.
  4. Read CurrentIndex to update the rest of your UI (labels, lock icons, star ratings...).
  5. Use the Carousel is busy condition to know if a slide is playing. Jump to index sets an item instantly, without animation.

Example project

Carousel-example.zip

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.

@NicolasDemangeat
NicolasDemangeat requested a review from a team as a code owner November 19, 2026 14:54
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.

1 participant