Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


- - - - -

Functions with default parameters


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 pbody2012   Members   -  Reputation: 115

Like
0Likes
Like

Posted 19 February 2013 - 05:42 PM

It is possible to register functions with defaults arguments and call them from the script.



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3453

Like
0Likes
Like

Posted 19 February 2013 - 06:05 PM

Yes, but you need to inform the default parameter value in the registration.

 

// C++
void func( int a, int b = 1 ) {}
 
// Registration with AngelScript
engine->RegisterGlobalFunction("void func(int, int b = 1)", asFUNCTION(func), asCALL_CDECL);

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 pbody2012   Members   -  Reputation: 115

Like
0Likes
Like

Posted 19 February 2013 - 10:53 PM

thnx






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS