Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | abhinavsingh |
GODOT HOW TO READ AND WRITE FILES IN ANDROID PLATFORM WITH FILE SYSTEM
I AM WORKING WITH FILE DIALOG
BELOW MY CODE FOR READ AND WRITE FILE
func _on_save_pressed():
$FileDialogsave.popup()
func _on_open_pressed():
$FileDialog.popup()
below save function
func _on_FileDialog_file_selected(path):
var file = File.new()
file.open(path, File.READ)
var texty = file.get_as_text()
$TextEdit.text = texty
file.close()
func _on_FileDialogsave_file_selected(path):
var text = $TextEdit.text
var file = File.new()
file.open(path, File.WRITE)
file.store_string(text)
file.close()
Does recording work on pc?
ramazan | 2021-12-21 09:57
yes it works on pc
you can check it on pc it works fine but on android it don’t work
abhinavsingh | 2021-12-21 16:27
var save_path = “C:/Users/xxx/Desktop/Game/save.dat” = for pc
var save_path = “user://data.dat” = for android
“Note = I couldn’t see the part you wrote in the folder”
ramazan | 2021-12-22 08:19
you can see video if you were unable to see save path
link of video below
abhinavsingh | 2021-12-23 06:11
sory . where is save script?
Are these in your save script?
var savepath = “C:/Users/xxx/Desktop/Game/save.dat” = for pc
var savepath = “user://data.dat” = for android
ramazan | 2021-12-23 10:44