New learner's question

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
BKFeng
Newbie
Posts: 13
Joined: Wed Aug 30, 2017 8:18 am
Contact:

New learner's question

#1 Post by BKFeng » Wed Aug 30, 2017 8:27 am

Hi! Nice to meet u all! I'm new to Ren'py but I have are understand some basics like if, variables, character, story, etc... I just want to ask know a few questions as listed below:
1) can I have the sample code of image button? Because I always have unknown error when I just use the official tutorial's method
2) about in app purchase:
A) same, can I have a sample code please :) Thanks
B) how can I collect the money I get (lol)

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: New learner's question

#2 Post by DannyGMaster » Wed Aug 30, 2017 9:16 am

To answer question 1)
There are various ways of setting up an imagebutton, one of the simplest would be this one.

Code: Select all

screen imagebutton_test():

    imagebutton: #Declare a new imagebutton
        xpos .3 #Set the x position
        ypos .5 #Set the y position
        idle "button_red.png" #Set the image to show when the button is idle (doing nothing)
        hover "button_red_hover.png" #The image when the button is hovered (mouse passes over it)
        action Function(renpy.notify, "Clicked!") #An action/event that runs when the button is clicked.
Right now I don't have time to elaborate on all that but play around with this code a little and check the Documentation for more info here: https://www.renpy.org/doc/html/screens. ... magebutton.
The silent voice within one's heart whispers the most profound wisdom.

BKFeng
Newbie
Posts: 13
Joined: Wed Aug 30, 2017 8:18 am
Contact:

Re: New learner's question

#3 Post by BKFeng » Mon Sep 04, 2017 11:57 am

Thanks bro/sis!

User avatar
Black Cat 2412
Regular
Posts: 74
Joined: Wed Aug 16, 2017 10:10 am
Projects: Rapunzel: A classic retold
Deviantart: BlackCat2412
Location: Vietnam
Contact:

Re: New learner's question

#4 Post by Black Cat 2412 » Mon Sep 04, 2017 2:02 pm

1) Learning imagebutton: Have you tried this? I learn a lot about imagebutton from it:

viewtopic.php?t=22565

Remember to download the latest version, though. Otherwise it won't work.

BKFeng
Newbie
Posts: 13
Joined: Wed Aug 30, 2017 8:18 am
Contact:

Re: New learner's question

#5 Post by BKFeng » Tue Sep 05, 2017 8:11 am

Black Cat 2412 wrote:
Mon Sep 04, 2017 2:02 pm
1) Learning imagebutton: Have you tried this? I learn a lot about imagebutton from it:

viewtopic.php?t=22565

Remember to download the latest version, though. Otherwise it won't work.
thanks <3

Post Reply

Who is online

Users browsing this forum: No registered users