GDevelop-extensions icon indicating copy to clipboard operation
GDevelop-extensions copied to clipboard

New extension: Custom Cursor

Open github-actions[bot] opened this issue 1 year ago • 0 comments

Description

This extension add a behavior that allow you to make a custom cursor from a sprite object.

You can (for the moment) use 2 animations:

  • One for the idle state (standard cursor)
  • One when a pressed event is detected (to display something else on a click)

How to use the extension

Add the behavior to a sprite object. The sprite object must meet the following criteria:

  • Have at least one animation (name it "idle"; see below to know how to use a custom name)

  • Origin point should be placed where you intend the user to click. It allow the behavior to correctly place the sprite (the location you use to click with the sprite should match the location used to click with the system cursor)

  • Optional The center point allow you to rotate the sprite around where you are supposed to click (the tip of your system cursor). Usefull when you want to rotate your sprite in the editor

Customize behavior

Add an animation that will be played when the user is pressing the right click

  • Enable the "Has pressed state" checkbox on the behavior settings
  • By default, the behavior will search for a "pressed" animation

Use another animation name

  • Override animation names used for idle and pressed in the behavior settings, under Idle Animation Name and Pressed Animation Name.

Checklist

  • [X] I've followed all of the best practices.
  • [X] I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • [X] I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

Demo Custom Cursor.zip

Extension file

CustomCursor.json.zip

github-actions[bot] avatar May 22 '24 19:05 github-actions[bot]