Native Tween

Status: Experiment

Version: 0.1

Supported platforms:

       

What's new?

For now improvement over lua GTween lib is not so big, even unnoticeable, probably because the calculations done while tweening are quite small, and this plugin still uses internal lua setters. That is why project is stopped until there will be a proper C Api for internal objects, that could work faster.

About Native Tween

Native implementation of Tweening library. Right now you can only create single simple tween, by tweening all values available to set method, and it dispatches complete event when tween is finished.
Api of library is made similar to existing lua implementation for better migration to new lib.

Code example:

local tw = GTween.new(shape, 10, {
		x = math.random(0, widthLimit), 
		y = math.random(0, heightLimit),
		scaleX = math.random(0.5, 1.5),
		scaleY = math.random(0.5, 1.5),
		rotation = math.random(-360, 360),
		redMultiplier = math.random(0, 1),
		greenMultiplier = math.random(0, 1),
		blueMultiplier = math.random(0, 1),
		alpha = math.random(0.3, 1)
	},
	{
		dispatchEvents = true
	})
	tw:addEventListener("complete", function()
		print("ended")
	end)