godot::tools

Function save

pub fn save<T>(obj: &Gd<T>, path: impl AsArg<GString>)
where T: Inherits<Resource>,
Expand description

⚠️ Saves a Resource-inheriting object into the file located at path.

See try_save for more information.

§Panics

If the resource cannot be saved.

§Example

use godot::prelude::*;

let obj = Resource::new_gd();
save(&obj, "res://BaseResource.tres")

use godot::