Useful Codes For GDScript
SLib is a versatile library whose functions are used in any project, SLib improves code quality several times, increases its readability, prevents errors, and thus makes your project better and faster than before! The following code is just one of the things that SLib does:
# This one line of code creates a backup of the player's data file with an optional
# extension next to it, it has the ability to check all types of errors and manage them,
# prevent syntax errors, repeating lines and code length.
SLib.backup_json_file("user://main_data.json")
# These 10 lines of code do the same thing as one line above, with the difference that
# the file extension and path must be specified in several places each time.
# and creates variables that are no longer usable!
var file_access := FileAccess.open("user://main_data.json", FileAccess.READ)
var json_string := file_access.get_line()
file_access.close()
var json := JSON.new()
json.parse(json_string)
var data = json.data
var backup_json_string := JSON.stringify(data)
var backup_file_access := FileAccess.open("user://main_data.json".get_basename() + "-Backup." +"user://main_data.json".get_extension(), FileAccess.WRITE)
backup_file_access.store_var(backup_json_string)
backup_file_access.close()
SLib is a Godot library designed to simplify and enhance your development experience. It provides a set of ready-to-use, standard codes that eliminate the need to write repetitive and lengthy scripts. SLib is lightweight, easy to install, and helps make your code more readable and maintainable.
Let's Install!
How does SLib help you?
Why is SLib a powerful and useful library?
Browse available versions
View the project development process
In which version of Godot can I use SLib?
Install SLib on your project
Convert simple texts into complex codes
Upgrade your code with SLib
Learn the details of SLib's capabilities
How to correct errors?
Join the SLib community and get help from each other
Documentation and user guide
This is an open source project, we grow together!
Project participation process and contributors