Hi,
I want clone and change the id for change the position.
The problem is that I don’t know how to change the id, because I don’t know what the clone id is.
Thank you for your future help.

Hi,
I want clone and change the id for change the position.
The problem is that I don’t know how to change the id, because I don’t know what the clone id is.
Hi @Lecricreator!
To change the position, you just need to use the node.
local node = gui.clone(gui.get_node("box"))
-- set the position and color of the new node
gui.set_position(node, vmath.vector3(400, 400, 0.5))
gui.set_color(node, vmath.vector4(1, 1, 0, 1))
Ok, it’s easier than I thought to change the position of the clone, but to change the id, I can’t. Is it possible to change the id?
Sure it’s possible, see the example in the documentation.
Also note that the function returns void, which means your id = gui.set_id()
will become nil
, which you cannot concatenate with your string.
Edit: Also, please post actual code, instead of screenshots. It will help us read the text, and others to search for similar issues.
We use Markdown formatting. Some examples here
Ah, that’s why the print didn’t work.
Ok, that was really what stuck me.
Thanks for all your answers.
I try Markdown with this example:
local help = {}
for n = 0, 5 do
help[n] = {}
help[n].node = gui.clone(gui.get_node("cross"))
gui.set_id(help[n].node, "newId"..n)
gui.set_position(gui.get_node("newId"..n), vmath.vector3(400 + (n * 40), 400, 0.5))
gui.set_color(help[n].node, vmath.vector4(1, 0, 0, 1))
end
How to make the page resolved?
Hello @Lecricreator,
I added “[SOLVED]” to the question title to signify it was resolved, I hope that’s okay?
Cheers,
Spen
Yes, perfect @SpencerWF . Thanks.