Please add gui.set function


I think it would be very convinient to have gui.set function , so it would be possible to write

gui.set(node, "position.x" , new_x)

instead of

local position = gui.get_position(node)
position.x = new_x
gui.set_position(node, postion)

gui.animate already works this way, there is also go.set , so I think gui.set begs to be implemented.



Yeah, a gui.set() might be useful for the kind of example you mentioned. If you find that you need to do these kind of things very frequently you could implement it yourself as a helper function and either monkeypatch the gui namespace or put it in a Lua module.



yeah, it is kind of what im doing now: i have a module which adds to gui functions set_x, set_y, set_alpha , holds local for module vmath.vector3 and vmath.vector4 to avoid creating temporaries for each call. I guess other properties need to be modified significantly less frequently and it is fine for now, but it seems to me usage of gui.set would be clearer. I hope you will be able to find time for this.

1 Like


Yeah the ”go.set()” was introduced after a while, and is our prefereed way of doing it now. The gui just hasn’t got that yet.