Simple Sparkle Effect is Material for creating a sparkle or glare effect on the sprite. You can adjust parameters such as size, angle, and position in the material constants, as well as animate them via go.animate()
To integrate the Sparkle Effect extension into your own project, add this project as a dependency in your Defold game. Open your game.project
file and add the following line to the dependencies field under the project section:
- I highly recommend using a single image in the atlas.
- Adjust the constants in the material so that they match your sprite.
- Copy the material in order to be able to edit the constants of the materials or set them via go.set() Adjust the constants in the material so that they match your sprite.
- Set sparkle_material to sprite then animate it.
function init(self)
--shader animation
local url = msg.url(nil, go.get_id(), "sprite")
go.animate(url, "pos.x", go.PLAYBACK_LOOP_FORWARD, 0.8, go.EASING_INSINE, 0.7)
end