Page 1 of 1

Social Media Suport In Game

Posted: Wed Jan 01, 2020 12:31 pm
by neometalero
Hi! I would like to know if there is any social media support in Renpy :!: :?: , I haven't been able to find anything about it. I want my users to be able to share images and/or text on social media, from inside my games. Tks!

Re: Social Media Suport In Game

Posted: Mon Jan 27, 2020 2:45 pm
by qirien
I was looking for this, too! Even if it were something as simple as taking a screenshot and then sharing...

Re: Social Media Suport In Game

Posted: Tue Jan 28, 2020 7:50 pm
by gas
I think that is quite difficult to implement due the continual change in the API of such social networks, and also can pose some issue on cookie laws for Renpy Web (not speaking some issue on artist credits). Such function could probably force to continual updates and break games on a daily basis!

You can use a normal URL link to direct the user on a social profile, and there use that media tools for sharing.

Re: Social Media Suport In Game

Posted: Tue Jan 28, 2020 9:51 pm
by qirien
I was thinking more for Android/iOS games where "sharing an image" appears to be something any app can do to pass data to another app.

Re: Social Media Suport In Game

Posted: Wed Jan 29, 2020 9:31 am
by gas
Same problem. Such phone apps and the very OS are continually updated when the API change (probably the very next hours!).
There's no native engine for that for the above reasons. Is not only sending an image, is the transfer protocol (the internal way of "sharing") that entirely change, while you as the user see nothing of it.
It CAN be done, but integrating a social sharing function in the core means breaking all games for older releases, even those that doesn't want to link on an external resources.

The reply is: renpy natively can't. You can with python, but the burden is on your shoulder. That's mean you should integrate a pyhton facebook API on your own (good luck!) and mangle the core a bit, and also allow for continual updates when that API change (and Facebook is infamous to make strange and even breaking updates). Not speaking Twitter is even worst.

Re: Social Media Suport In Game

Posted: Wed Jan 29, 2020 2:36 pm
by xavimat
That said, you can make renpy read and send things to a web page and maybe have that web (not renpy) do the sharing with social media.
It's possible to use urllib2 inside renpy to send and read info from a php page.
That php can make lots of things, like send automatic emails and update a database.
I don't know about the social sharing, but it should be doable with php.


EDIT:
This example code will share some info in twitter from renpy:

Code: Select all

textbutton "Share on twitter" action OpenURL("http://twitter.com/share?text=Hey guys, I've reached Ending 4 “You're magnificient” in the fantastic game “Praise Yourself”&url=https://praiseyourself.com")

Re: Social Media Suport In Game

Posted: Tue May 12, 2020 6:50 pm
by qirien
Actually, it looks like I might be able to do this with Jnius
https://github.com/kivy/pyjnius
as stated on this thread:
viewtopic.php?p=461111#p461111