mirror of
https://github.com/rm-code/Graphoon.git
synced 2024-11-16 18:24:22 +00:00
Add varargs to the list of parameters a Node can receive
This commit is contained in:
parent
af7f49a2ad
commit
8146caa558
@ -64,9 +64,10 @@ function Graph.new()
|
|||||||
-- @param y - The y coordinate the Node should be spawned at (optional).
|
-- @param y - The y coordinate the Node should be spawned at (optional).
|
||||||
-- @param anchor - Wether the node should be locked in place or not (optional).
|
-- @param anchor - Wether the node should be locked in place or not (optional).
|
||||||
--
|
--
|
||||||
function self:addNode( id, x, y, anchor )
|
function self:addNode( id, x, y, anchor, ... )
|
||||||
|
print( id, x, y, anchor, parent, path, spritebatch )
|
||||||
assert( not nodes[id], "Node IDs must be unique." );
|
assert( not nodes[id], "Node IDs must be unique." );
|
||||||
nodes[id] = Node.new( id, x, y, anchor );
|
nodes[id] = Node.new( id, x, y, anchor, ... );
|
||||||
return nodes[id];
|
return nodes[id];
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ local DEFAULT_MASS = 0.05;
|
|||||||
-- @param y - The y coordinate the Node should be spawned at (optional).
|
-- @param y - The y coordinate the Node should be spawned at (optional).
|
||||||
-- @param anchor - Wether the node should be locked in place or not (optional).
|
-- @param anchor - Wether the node should be locked in place or not (optional).
|
||||||
--
|
--
|
||||||
function Node.new( id, x, y, anchor )
|
function Node.new( id, x, y, anchor, ... )
|
||||||
local self = {};
|
local self = {};
|
||||||
|
|
||||||
local px, py = x or 0, y or 0;
|
local px, py = x or 0, y or 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user