setup native script

This commit is contained in:
zoe 2022-05-01 19:47:50 +02:00
parent b0a9525111
commit c8046a6e85
9 changed files with 44 additions and 4 deletions

View file

@ -1 +1,9 @@
use gdnative::prelude::*;
mod stateserver;
fn init(handle: InitHandle) {
handle.add_class::<stateserver::StateServer>();
}
godot_init!(init);

View file

@ -0,0 +1,18 @@
use gdnative::prelude::*;
#[derive(NativeClass)]
#[inherit(Node)]
pub struct StateServer;
#[methods]
impl StateServer {
fn new(_owner: &Node) -> Self {
StateServer
}
#[export]
fn _ready(&self, _owner: &Node) {
godot_print!("hello, state")
}
}