bzAnim -- Bezier Animation Module

Mostly just for my own experimentation, but I built out a simple animation library that uses Bezier curves to interpolate between points (which may not always be what you want).

https://github.com/jbp4444/bzAnim

Usage:

  • Attach bzController.script to your collection
  • Include the library: local bz = require("bzAnim.bzLibrary")
  • Then …
bz.animate({ 
	obj = gfx_obj_url, 
	duration = 4.0,   -- default=1.0
	delay = 0.0,      -- default=0.0
	path={ -- starts at current position, say x=100, y=100
		{ x=100,y=500 },
		{ x=500,y=500 },
		{ x=900,y=500 },
		{ x=900,y=100 },
	},
})

Includes a working demo/example.

Definitely “beta” code at this point – and my first attempt at a Defold package.

18 Likes

Thank you for sharing this! I’m sure it will be useful to others.

4 Likes