Tweening nested tables
masterThe tween.lua library supports deep interpolation. If the subject and target tables contain subtables, the library will attempt to tween the values within those subtables.
Requirement: The 'leaf' values (the actual values being changed) must be numbers in both the subject and the target tables.
Example:
-- Fading colors using RGB tables
local properties = { bgcolor = {255, 255, 255}, fgcolor = {0, 0, 0} }
local target = { bgcolor = {0, 0, 0}, fgcolor = {255, 0, 0} }
local fadeTween = tween.new(2, properties, target, 'linear')local properties = {bgcolor = {255,255,255}, fgcolor = {0,0,0}}
local fadeTween = tween.new(2, properties, {bgcolor = {0,0,0}, fgcolor={255,0,0}}, 'linear')