class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCounted ResourceFormatSaver
Saves a specific resource type to a file.

The engine can save resources when you do it from the editor, or when you use the ResourceSaver singleton. This is accomplished thanks to multiple ResourceFormatSavers, each handling its own format and called automatically by the engine.

By default, Godot saves resources as .tres (text-based), .res (binary) or another built-in format, but you can choose to create your own format by extending this class. Be sure to respect the documented return types and values. You should give it a global class name with class_name for it to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving resources of its recognized type(s). You may also implement a ResourceFormatLoader.

PackedStringArray _get_recognized_extensions<>( Resource resource=, resource:Resource=, ):PackedStringArray

Returns the list of extensions available for saving the resource object, provided it is recognized (see _recognize).

bool _recognize<>( Resource resource=, resource:Resource=, ):bool

Returns whether the given resource object can be saved by this saver.

bool _recognize_path<>( Resource resource=, resource:Resource=, String path=, path:String=, ):bool

Returns true if this saver handles a given save path and false otherwise.

If this method is not implemented, the default behavior returns whether the path's extension is within the ones provided by _get_recognized_extensions.

Error _save<>( Resource resource=, resource:Resource=, String path=, path:String=, int flags=, flags:int=, ):Error

Saves the given resource object to a file at the target path. flags is a bitmask composed with SaverFlags constants.

Returns @GlobalScope.OK on success, or an Error constant in case of failure.

Error _set_uid<>( String path=, path:String=, int uid=, uid:int=, ):Error

Sets a new UID for the resource at the given path. Returns @GlobalScope.OK on success, or an Error constant in case of failure.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...