-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use preload? #400
Comments
Unfortunately, there is no equivalent to
This is only possible in GDScript because the parser is deeply integrated into the engine. You can use I'd suggest that |
Also, you can always put a |
Thanks for the detailed answer. If I understand this right it seems like we lose an optimization here. When porting from GDScript to Rust I moved preload calls into ready, and used the global ResourceLoader to load them. It worked fine, but I can imagine in some situations you'd want to use the ResourcePreloader as a node to get the same effect as the preload function. This might be a good item for issue https://github.com/godot-rust/godot-rust/issues/330 |
Added to the tracker. Thanks! |
Going through my own code, I've been replacing uses of GDScript's
preload
with a call to theResourceLoader
and using theload
function in the_ready
hook.I recently discovered that there is a
ResourcePreloader
- which is used by thepreload
function available in godot-rust, but I can't find any examples of it being used. Is this a case where the ResourcePreloader isn't actually useful in GDNative? Or could I actually use it and take advantage of pre-loading?The text was updated successfully, but these errors were encountered: