Open .txt file with imagebutton or textbutton

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Austinplayz
Newbie
Posts: 1
Joined: Tue Mar 17, 2020 4:26 pm
Projects: New Life
Soundcloud: RealDeepEDM
Location: Sellersburg, Indiana
Contact:

Open .txt file with imagebutton or textbutton

#1 Post by Austinplayz »

Hey! Is it possible to have a textbutton or an imagebutton open a .txt file when it is clicked?
Something like this (which ik that code isn't right but it's my example lol);
textbutton _("Button") action Open("file.txt")

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Open .txt file with imagebutton or textbutton

#2 Post by RicharDann »

There isn't a function that explicitly does this unless you create one yourself, but there's the OpenURL() action that can open a web page or an html file in the browser.

You could use an html file instead of txt (though a plain txt might also work), and set it to the button as a local url.
The most important step is always the next one.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]