0 votes

So i've been searching on how to read text file in godot and when i try to use the code it printed out a strange text and then i realize that the file is rtf, so i'm searching on how rtf encoding works but i still don't know how to read the file(Rich Text Format) in godot.

I'm sorry because of my bad english.

BTW this is my code to open Rich Text Format file:

var f = File.new()
if f.file_exists("res://content.rtf"):
    f.open("res://content.rtf", File.READ)
    $content.bbcode_text = f.get_as_text()
Godot version v3.2.2
in Engine by (14 points)

1 Answer

+1 vote

Godot doesn't have a way to read RTF files by default. You'll have to write your own parser or just don't save your files as RTF.

by (8,524 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.