I’m doing experiments with gui script, and i don’t understand how the z value of nodes is treated.
function init(self)
local box_z = -0.5
box = gui.new_box_node(vmath.vector3(100,500,box_z), vmath.vector3(200,20,0))
gui.set_color(box, vmath.vector3(1/6,1/3,1/2,1))
for i=1,10 do
gui.new_text_node(vmath.vector3(100,600-i*20,0), "this is text node " .. i)
end
end
This code creates some lines of text, and add a box for highlighting one of them.
It works, but when i change the variable box_z
to positive 0.5
, i expect that this box will be above the line.
But it stays under, whatever value i put to box_z
.
It’s very strange.
Thank you for reading