Page 1 of 1

new component idea

Posted: Wed Dec 31, 2008 2:15 pm
by kattle87
Would it be usefull to add a "ZFunction" component similar to ZLibrary, but which is able to define only one function that can have other components as children? Or have a function in a ZExpression to call the execution of a "Group" component might also be an elegant solution.

EG: I create a function or a group called "refresh" that contains several "RefreshContent" components so that I can use it inside a ZExpression when I need it. I know there are other ways for doing this but this might be usefull for cleaness of code and for other nasty stuff (EG: the "remove model" posted by Tischk)

Posted: Wed Dec 31, 2008 2:26 pm
by Kjell
Hmm,

It's a good idea, but I guess you wouldn't be able to pass any arguments like you can with functions defined in a ZLibrary, right? The general structure I use now is a Condition Component that checks whether the Function variable > 0, and every loop it subtracts 1 off that value .. so you can call the function multiple times per frame ( arguments are passed using a Array ). But I agree, it's workaround-ish :)

K