Description
Adds a Carousel behavior that turns sprites object with 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
The Tween behavior is required and added automatically when Carousel is added to an object (nothing extra to set up).
Can work with the swipe gesture extension.
How to use the extension
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:
- Set
MinIndex and MaxIndex to match the number of animations on your object (0-based: the first animation is index 0)
- Enable
Loop if the carousel should wrap around at the ends
- Call
Next() / Previous() from your arrow buttons
- Read
CurrentIndex() to update the rest of your UI (labels, lock icons, star ratings...)
- Use
IsBusy() to know if the Carousel is playing tween.
Checklist
AI usage
Example file
Carousel-example.zip
Extension file
Carousel.zip
Description
Adds a Carousel behavior that turns sprites object with animations into a looping, sliding carousel item.
Calling
Next()orPrevious():Configurable properties (visible directly in the Scene Editor, per instance):
MinIndex/MaxIndex: the range of animation indexes to cycle throughLoop: wrap around at the ends instead of stoppingSlideDistance: how far the item slides off-screenDuration: how long each slide takes, in secondsThe Tween behavior is required and added automatically when Carousel is added to an object (nothing extra to set up).
Can work with the swipe gesture extension.
How to use the extension
Put the Carousel behavior on a sprite with multiple animations to build:
Setup:
MinIndexandMaxIndexto match the number of animations on your object (0-based: the first animation is index0)Loopif the carousel should wrap around at the endsNext()/Previous()from your arrow buttonsCurrentIndex()to update the rest of your UI (labels, lock icons, star ratings...)IsBusy()to know if the Carousel is playing tween.Checklist
AI usage
Example file
Carousel-example.zip
Extension file
Carousel.zip