move settings node from factory to component (#8)

This commit is contained in:
Maxim Tuprikov
2019-03-29 00:51:37 +03:00
committed by GitHub
parent 12f5f22b69
commit 7395f029e0
6 changed files with 25 additions and 23 deletions

View File

@@ -18,6 +18,15 @@ function M.centrate_text_with_icon(text_node, icon_node, offset_x)
end
local STRING = "string"
function M.get_node(node_or_name)
if type(node_or_name) == STRING then
return gui.get_node(node_or_name)
end
return node_or_name
end
function M.step(current, target, step)
if current < target then
return math.min(current + step, target)