Jump to content

[SOLVED] calling class instance function from UI


photo

Recommended Posts

I have this situation

class X

{

  void foo()

 {

 ...

 }

}

 

 

 

X xinst=new X();

 

and ui file with

<callback type="clicked">xinst.foo</callback>

 

 

But, i get the can't find callback function error. Any help? Thanks.

Link to comment

Not sure, but you cannot call class instance functions directly, only static functions. Have a look into UNIGINE editor script code in <sdk-root>/data/core/editor, there should be plenty of examples for your use case.

Link to comment
×
×
  • Create New...