Skip to content

Commit

Permalink
Able to use string name of tween
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Nov 11, 2024
1 parent b891dc6 commit e7988b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tweener/tweener.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function M.tween(easing_function, from, to, time, callback, update_delta_time)
update_delta_time = update_delta_time or (1 / UPDATE_FREQUENCY)

-- Acquire the easing function
easing_function = M.DEFOLD_EASINGS[easing_function] or easing_function
easing_function = M.DEFOLD_EASINGS[easing_function] or M[easing_function] or easing_function
local easing_type = type(easing_function)
if easing_type == TYPE_USERDATA or easing_type == TYPE_TABLE then
easing_function = get_custom_easing(easing_function --[[@as vector]])
Expand Down Expand Up @@ -83,7 +83,7 @@ function M.ease(easing_function, from, to, time, time_elapsed)
return to
end

easing_function = M.DEFOLD_EASINGS[easing_function] or easing_function
easing_function = M.DEFOLD_EASINGS[easing_function] or M[easing_function] or easing_function
local easing_type = type(easing_function)
if easing_type == TYPE_USERDATA or easing_type == TYPE_TABLE then
return M.custom_easing(easing_function, time_elapsed, from, to - from, time)
Expand Down

0 comments on commit e7988b0

Please sign in to comment.