Urs Holzer wrote:
> So it would be good if I could do something like
>
> cubic {
> state.light .. "1.jpeg",
> state.light .. "2.jpeg",
> state.light .. "3.jpeg",
> ....
>
> Is this possible?
Apparently you haven't tried it? Yes, this is possible. You can use any
Lua expression that evaluates to a string at any place where a string is
expected (and likewise for all other data types). Don't forget that
"cubic" is just a function and "{...}" is just one way of specifying a
table, so, assuming that state.light is a boolean value, you could also
write something like
cubic(state.light and {"1l.jpeg", ... } or {"1d.jpeg", ... })
(the parentheses are necessary if the opening brace doesn't immediately
follow "cubic")
or
if state.light then
cubic {"1l.jpeg", ... }
else
cubix {"1d.jpeg", ... }
end
However, I wouldn't really call that "changing the node images", since
it only takes effect when the node is loaded. If you want the change to
happen while that node is displayed, you must reload it
(pipmak.gotonode(pipmak.getcurrentnode())). There's currently no way of
changing the node background images "on the fly".
-Christian
|