I am just getting started with Ren'Py and before I get too far, I need to know if it is possible to make a button that when clicked will bring up the print dialog and allow the user to print the contents of the game window ?? e.g. what's on the game screen
Thanks! Megan
Can Ren'Py make a button that will print the window/screen ?
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.
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.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Can Ren'Py make a button that will print the window/scre
This isn't possible in Ren'Py.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Can Ren'Py make a button that will print the window/scre
*Sigh* OK, Thanks
-
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
- Contact:
Re: Can Ren'Py make a button that will print the window/scre
I have a suggestion, although it's not perfect and I haven't really looked into writing files in ren'py and ensuring stuff gets into the correct place, but:
1) Ren'Py can take screenshots (renpy.screenshot())
2) Ren'Py can write arbitrary files (Python file support)
3) Ren'Py can open a web browser to a file on disk (Help(), although this is a screen action, those are easy enough to force)
4) JavaScript can be used to open a print dialog (window.print())
So, take a screenshot, write out a HTML file including that screenshot and some Javascript that opens the print dialog and then have a screen open that HTML file in a web browser. With any luck Firefox or Chrome or whatever will pop open and the print dialogue will come up.
1) Ren'Py can take screenshots (renpy.screenshot())
2) Ren'Py can write arbitrary files (Python file support)
3) Ren'Py can open a web browser to a file on disk (Help(), although this is a screen action, those are easy enough to force)
4) JavaScript can be used to open a print dialog (window.print())
So, take a screenshot, write out a HTML file including that screenshot and some Javascript that opens the print dialog and then have a screen open that HTML file in a web browser. With any luck Firefox or Chrome or whatever will pop open and the print dialogue will come up.
Re: Can Ren'Py make a button that will print the window/scre
Awesome Suggestion! Thanks so much for thinking of this and posting the reply - I will try it ~Megan
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Can Ren'Py make a button that will print the window/scre
You can also just use the webbrowser module directly.Asceai wrote:3) Ren'Py can open a web browser to a file on disk (Help(), although this is a screen action, those are easy enough to force)
Code: Select all
init python:
import webbrowser
webbrowser.open('http://www.google.com')
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Can Ren'Py make a button that will print the window/scre
Thanks! You guys are just SO helpful here -> use case: I am wanting to make some learning activities and wanted to have some accompanying "printables" for use outside the program - that is the idea anyway - been looking at different options and Ren'Py looks like a good possibility for accomplishing what I have in mind
thank you again, Megan
thank you again, Megan
Re: Can Ren'Py make a button that will print the window/screen ?
And it is possible to embed the webbrowser into the screen?
Who is online
Users browsing this forum: No registered users