Page 1 of 1

New learner's question

Posted: Wed Aug 30, 2017 8:27 am
by BKFeng
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)

Re: New learner's question

Posted: Wed Aug 30, 2017 9:16 am
by DannyGMaster
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.

Re: New learner's question

Posted: Mon Sep 04, 2017 11:57 am
by BKFeng
Thanks bro/sis!

Re: New learner's question

Posted: Mon Sep 04, 2017 2:02 pm
by Black Cat 2412
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.

Re: New learner's question

Posted: Tue Sep 05, 2017 8:11 am
by BKFeng
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