Edit of asset "HoverShake2D" Accepted

Old/Current New/Edit
Title HoverShake2D HoverShake2D
Description This is a simple script/class that you can use on a node that inherits Node2D (e.g. Sprite). This script is an easy way to add a nice hover or shake effect to your nodes without the need of any additional child nodes.

var hover_shake = HoverShake2D.new()

In your node's _ready() function, initialize the behavior using your node as its target:

func _ready():
hover_shake.init(self)

Then, during your node's _update() function, simply pass the delta into the behavior:

func _process(delta):
hover_shake.update(delta)


Now your node is hovering! Or shaking, if you use extra options:

hover_shake.init(self, "random", 0, 2, 200) // fast shake

- Second parameter is starting direction, possible values are "random", "up", "down", "left", "right" (default "random")
- Third parameter is vertical distance of the hover in pixels (0 for no hover, default 15)
- Fourth parameter is horizontal distance of the shake in pixels (0 for no shake, default 0)
- Fifth parameter is speed of the hover/shake (default 10)

That's it! Super easy hover, super simple shake. Enjoy!
This is a simple script/class that you can use on a node that inherits Node2D (e.g. Sprite). This script is an easy way to add a nice hover or shake effect to your nodes without the need of any additional child nodes.

var hover_shake = HoverShake2D.new()

In your node's _ready() function, initialize the behavior using your node as its target:

func _ready():
hover_shake.init(self)

Then, during your node's _update() function, simply pass the delta into the behavior:

func _process(delta):
hover_shake.update(delta)


Now your node is hovering! Or shaking, if you use extra options:

hover_shake.init(self, "random", 0, 2, 200) // fast shake

- Second parameter is starting direction, possible values are "random", "up", "down", "left", "right" (default "random")
- Third parameter is vertical distance of the hover in pixels (0 for no hover, default 15)
- Fourth parameter is horizontal distance of the shake in pixels (0 for no shake, default 0)
- Fifth parameter is speed of the hover/shake (default 10)

That's it! Super easy hover, super simple shake. Enjoy!
Category Scripts Scripts
License CC0 CC0
Repository Provider GitHub GitHub
Repository Url https://github.com/SlushyGames/HoverShake2D https://github.com/SlushyGames/HoverShake2D
Issues Url https://github.com/SlushyGames/HoverShake2D/issues https://github.com/SlushyGames/HoverShake2D/issues
Godot version Godot 3.2 Godot 3.2
Version String 1.0 1.0
Download Commit 5d4c2862505314955ac5ebaef2072d2652d0469f 5d4c2862505314955ac5ebaef2072d2652d0469f
Download Url (Computed) https://github.com/SlushyGames/HoverShake2D/archive/5d4c2862505314955ac5ebaef2072d2652d0469f.zip https://github.com/SlushyGames/HoverShake2D/archive/5d4c2862505314955ac5ebaef2072d2652d0469f.zip
Icon Url https://raw.githubusercontent.com/SlushyGames/HoverShake2D/main/hovershake2d_thumbnail.png
https://raw.githubusercontent.com/SlushyGames/HoverShake2D/main/hovershake2d_thumbnail.png