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

Hover on sprite objects

Open github-actions[bot] opened this issue 2 years ago • 3 comments

Description

Add a behavior on sprites objects to have a simple hover animation. You can set a speed and a size and when mouse is on the sprite object, an animation change the object's size.

How to use the extension

Add it on a sprite object. Set the speed and the number of pixels to add to the width and height. Launch project and you'll see the animation when you have the mouse on or out of the sprite.

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?

Reviewed

Example file

Hover.zip

Extension file

SpriteHover.json.zip

github-actions[bot] avatar Jul 25 '22 15:07 github-actions[bot]

Hello @FlorentMaillot ,Great work in the extension :3 here is few things I noticed that require a fix: • The example have an empty event. • The example is using Health extension yet its not used in the project better to delete it for a clean project. • The example have unused assets/sprites (Newsprite) object, better to delete it. • The example scene should be named in English. • Extension tags should be separated with a Comma (,) not Semicolon (;). • Comments in the extension should explain what the events do only. • Variables names should follow the best practices, for example you variable Hover should be replaced with __SpriteHover.Hover same thing apply for all the variables. • Delete empty events in the extension. • You can use Tween to make things juicer and smoother, rather than adding and subtracting pixels using variables.

Good job on the extension once again 😉 have you ever checked my extension (Animation system) ? it contain this effect and many other effects all in 1 place :)

VegeTato avatar Jul 29 '22 10:07 VegeTato

Hello @VegeTato . Thank you for your advices. I'm working on it, already fixed the littles (variables names, empty and unused datas...) and trying to make a version with the use of the Tween behavior. I'm trying to find if the Sprite object has the Tween behavior on it or not and if it don't, adding it in js code.

I'll repost the new exemple project in few days.

Before creating this extension I searched for one doing the hover animation using the Hover tag and I don't find what I wanted. I didn't see your Animation system extension. Sure I'll give it a try !

Thank you again !

FlorentMaillot avatar Aug 03 '22 07:08 FlorentMaillot

Hello.

I didn't succeeded to make a working version using the Tween behavior in an automatic way for users. I wanted to automatically add the Tween Behavior on objects which have the SpriteHover behavior (in the OnCreated event in javascript).

Here are the exemple version with the best practices advices, and the corrected behavior file.

Hover.zip

SpriteHover.json.zip

Florent.

FlorentMaillot avatar Aug 08 '22 15:08 FlorentMaillot

Thank you for submitting an extension. It seems that this other extension already covers your submission: https://wiki.gdevelop.io/gdevelop5/extensions/button-states/

D8H avatar Mar 18 '24 23:03 D8H