[−][src]Macro gdnative::godot_class
Convenience macro to declare a native class.
Example
ⓘThis example is not tested
godot_class! { class HelloWorld: godot::Node { fields { x: f32, } setup(builder) { builder.add_property( Property { name: "base/x", default: 1.0, hint: PropertyHint::Range { range: 0.0..1.0, step: 0.01, slider: true }, getter: |this: &mut RustTest| this.x, setter: |this: &mut RustTest, v| this.x = v, usage: PropertyUsage::DEFAULT, } ); } constructor(_owner: godot::Node) { HelloWorld { x: 0.0, } } export fn _ready(&mut self, _owner: godot::Node) { godot_print!("hello, world."); } } }