Page 1 of 1

Can Ren'Py make a button that will print the window/screen ?

Posted: Wed Feb 05, 2014 8:01 am
by megan328
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

Re: Can Ren'Py make a button that will print the window/scre

Posted: Wed Feb 05, 2014 9:18 am
by PyTom
This isn't possible in Ren'Py.

Re: Can Ren'Py make a button that will print the window/scre

Posted: Wed Feb 05, 2014 9:31 am
by megan328
*Sigh* OK, Thanks

Re: Can Ren'Py make a button that will print the window/scre

Posted: Wed Feb 05, 2014 6:41 pm
by Asceai
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.

Re: Can Ren'Py make a button that will print the window/scre

Posted: Wed Feb 05, 2014 7:06 pm
by megan328
Awesome Suggestion! Thanks so much for thinking of this and posting the reply - I will try it :-) ~Megan

Re: Can Ren'Py make a button that will print the window/scre

Posted: Wed Feb 05, 2014 7:48 pm
by PyTom
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)
You can also just use the webbrowser module directly.

Code: Select all

init python:
    import webbrowser

webbrowser.open('http://www.google.com')
What's the use case, anyway?

Re: Can Ren'Py make a button that will print the window/scre

Posted: Thu Feb 06, 2014 11:11 am
by megan328
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

Re: Can Ren'Py make a button that will print the window/screen ?

Posted: Sun Oct 06, 2019 1:36 pm
by Chivone
And it is possible to embed the webbrowser into the screen?