Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
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!
HoverShake2D
A simple but effective way to add a hover or a shake effect to any node that extends Node2D using the Godot Engine v3.2. Doesn't make use of any child nodes.
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!
Reviews
Quick Information
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!