Quote:
Originally Posted by Justin
If you changed local(a1,b1) to instance(a1,b1), I believe this might work! local namespace support would be nice, too, but it isn't currently supported.
|
yes. but won't we end up with <psuedo-object>.a1.r/g/b/a and <psuedo-object>.b1.r/g/b/a for every psuedo-object which uses rgbamix2()? i guess i haven't wanted to load up the Js namespace any more than i need to. it already gets to be a pretty massive variables list in the debug window. :^)
and fwiw... what i'd really love to see someday is a way to alias psuedo-object namespaces inside functions. something like:
Code:
// rgbamix2( mix, a, b )
function rgbamix2( mix, @a1, @b1 )
instance( r, g, b, a )
(
mix1= 1-mix;
r= a1.r * mix1 + b1.r * mix; // r= a.r * mix1 + b.r * mix
g= a1.g * mix1 + b1.g * mix;
b= a1.b * mix1 + b1.b * mix;
a= a1.a * mix1 + b1.a * mix;
);
just sayin'... :^)
enjoy! /dan
ps- also fwiw, stack_push()/pop() are awesomely useful generally. thanks so much for those.