-
-
Notifications
You must be signed in to change notification settings - Fork 712
Open
Labels
enhancementThis is an enhancement on the current functionalityThis is an enhancement on the current functionality
Description
Hi there,
I wondered if it was possible to instantiate a custom GDNative class with arguments in GDNative code.
This could be useful in several situations e.g. :
- class with const members which require a parametrized constructor with initialization list
- inline-style instanciation like
some_function(some_class::_new(/* some arguments */));
As far as I understand GDNative library, it seems a custom class some_class is intanciated by NativeScript::new_() itself called from the some_class::_new() function itself inserted by the GODOT_CLASS() macro.
However in this processus no argument is passed.
Anyone could tell me a bit more about how to use the C++ constructors and/or the _init() method to pass arguments upon instanciation ?
Best
Flarkk
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementThis is an enhancement on the current functionalityThis is an enhancement on the current functionality