Share button on mobile devices

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
apexchimps
Regular
Posts: 29
Joined: Mon Jan 25, 2016 6:12 pm
Completed: Detective Max, Nick's Night Out!, Arthur & Susan: Almost Detectives
Projects: Arthur & Susan: Almost Detectives
Contact:

Share button on mobile devices

#1 Post by apexchimps »

Hi,

Do anyone know if it's possible to create a share button on Renpy. We have succesfully created buttons to open URLs with the OpenURL actions. But, is it possible to create a predefined text with a link and open the phone's menu to select the channel to share the message (Twitter, Whatsapp...)?

Code: Select all

screen follow:
    imagemap:
        ground "Images/follow.jpg"
        hotspot (375, 25, 525, 150) clicked OpenURL("https://twitter.com/apexchimps")
        hotspot (160, 120, 330, 220) clicked OpenURL("https://instagram.com/apexchimps")
        hotspot (1000, 300, 1200, 450) clicked OpenURL("https://play.google.com/store/apps/details?id=com.apexchimps.detectivemax")
Thank you in advance.

Best regards.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Share button on mobile devices

#2 Post by Imperf3kt »

What do you mean by share?
Take a screenshot and post it to said social media?

You'll probably need to use their API, and that will only work if it is written with python compatibility, and if renpy can support it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
apexchimps
Regular
Posts: 29
Joined: Mon Jan 25, 2016 6:12 pm
Completed: Detective Max, Nick's Night Out!, Arthur & Susan: Almost Detectives
Projects: Arthur & Susan: Almost Detectives
Contact:

Re: Share button on mobile devices

#3 Post by apexchimps »

Easier than a screenshot. Just a text that says something like "This game is great, you should try it + LINK", so it opens the 'Share via' menu, and the user can select Whatsapp, Hangouts, Gmail... Something like this picture.

Image

In Android is easy, but I don't find it in renpy/python.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Share button on mobile devices

#4 Post by Imperf3kt »

The first Google result I pulled, looks useful.
https://www.geeksforgeeks.org/tweet-using-python/
The instructions are for Linux, but on Windiws just use the usual install methods.

I had searched for "python post to twitter"
Similar searches for Facebook etc, may be just as fruitful.


Will it work with Ren"Py?
Maybe. I cannot say as I havent tried.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]