Skip to content

New extension: Unique selection visual#2181

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
extension/Aldebaran-Studio/2180
Open

New extension: Unique selection visual#2181
github-actions[bot] wants to merge 1 commit into
mainfrom
extension/Aldebaran-Studio/2180

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Manages the visual, the audio and the boolean of a selection with the cursor.
it works with a behaviour and a module that you put in the event sheet. (they go hand in hand)

---CONTEXT--- and the problem it solves

this extension exist because the selection visual, sound, and variable (which are interconnected when dealing with cursor selection) are tricky for beginners to do. even though its a seemingly simple task. This is because when the cursor stops hovering on the first item, it might end up on another item without untrigerring the trigger once (due to the fact that selectables are next to each other). This issue is the main reason as to why the extension exist. Only one square should be selected at a time, hence the name: Unique Selection Visual

However... its sad to make an extension for just the visual (item get bigger when hovered). So I manage both the sound (selected and hovered) and the variable selected (stored in a behaviour property)

selection can be unique or capped

(note that this is my first published extension, be nice)
(note that i do not know JS so all the code is using events from GD)
(this extension uses another extension by silverstreak and krunkster named: play audio by file name. Because of this I want to credit them. do i have to do it manually or is the dependency automatically detected?)

proudly NO AI

How to use the extension

1: assign the behaviour "Unique sprite selection" to all your selectable sprites.

2: associate a sound for the hovering sound and/or the selection sound in the behaviour property. these can change dynamically and be different from instance to instance.

3: put the action "UniqueSelectionModule" in your event sheet. with the sprites having the behaviour. You can put a group, but every element of the group must be sprites and have the behaviour

4: if you want the selection to be unique (i.e. only one item will be selected at a time), put a 1 as the maxSelected. if you want many items to be selected at a time, you can increase that number to whatever you want (putting a float will not break the extension, it is just as if the number was truncated).

anytime you want to check the state of the selection boolean, use "sprite is selected" condition (and reverse it for checking unselected)

Checklist

  • I've followed all of the best practices.
  • 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.

Example file

small tests.zip

Extension file

UniqueSelectionVisual.zip


Extension by @Aldebaran-Studio

You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type !update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:

!update [MyExtension.zip](https://github.com/GDevelopApp/GDevelop-extensions/files/12709661/MyExtension.zip)

It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!

@github-actions github-actions Bot requested a review from a team as a code owner July 2, 2026 18:58
@github-actions github-actions Bot added the ✨ New extension A new extension label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ New extension A new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant