[Solved]How to have buttons on your game?Not really imagemap

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
Kiri_Meow
Newbie
Posts: 5
Joined: Fri Dec 24, 2010 9:22 am
Contact:

[Solved]How to have buttons on your game?Not really imagemap

#1 Post by Kiri_Meow »

What I'm talking about is that button beside the narration/dialogue box.
For example, in the Alistair VN.
Image

I encircled those "buttons" which I am talking about. I also saw those kinds of buttons in the Starry Sky VN.
So how do you put those things there? I mean, what's the code? I tried using imagemaps but failed (cause I'm a noob). xD
I searched for other codes and found Imagebuttons. I'm not sure if that's what the author used, so I'm asking you guys.

Please help me~!!! :? :? :? :? :? :?
Last edited by Kiri_Meow on Sat Dec 25, 2010 4:59 am, edited 1 time in total.

EternalDream
Veteran
Posts: 208
Joined: Sat Nov 27, 2010 6:04 pm
Completed: Secret Santa
Projects: Memory Lane
Contact:

Re: (noob)How to have buttons on your game? Not really image

#2 Post by EternalDream »

I think it's called menu buttons, the code for simples ones is in the link below:

http://www.renpy.org/wiki/renpy/doc/coo ... _Game_Menu

Just follow the instructions
To make it like Starry Sky or RE:Alistair... I guess you'll be needing some pro programmers XD IDK Also currently trying to figure out how to make the menu buttons look more like that.

User avatar
Sapphi
Eileen-Class Veteran
Posts: 1685
Joined: Fri Jun 05, 2009 3:31 am
Completed: Boku no Taisetsu na Yumeko
Projects: Twelve, PAW ★ PRINTS
Organization: Kitsch-soft
Location: Illinois, USA
Contact:

Re: (noob)How to have buttons on your game? Not really image

#3 Post by Sapphi »

I'll just copy/paste what I'm using and maybe you can play around with it and make it work for you. The buttons I have are save, load, auto read, skip, and one that brings up the preferences screen. The "text/___.png" stuff is what you replace with the name of your button. At the moment these are aligned horizontally at the bottom right-hand corner of the screen in my 800x600 window, but you can move them around as you like with xpos and ypos and a bit of trial and error.

This goes in your init:

Code: Select all

screen save_button:
     imagebutton:
         idle "Text/save.png"
         hover "Text/save2.png"
         xpos 435 ypos 562
         action ShowMenu("save")
         
screen load_button:
     imagebutton:
         idle "Text/load.png"
         hover "Text/load2.png"
         xpos 500 ypos 562
         action ShowMenu("load")

screen auto_button:
     imagebutton:
         idle "Text/auto.png"
         hover "Text/auto2.png"
         xpos 570 ypos 562
         action Preference("auto-forward", "toggle")
         
screen skip_button:
     imagebutton:
         idle "Text/skip.png"
         hover "Text/skip2.png"
         xpos 635 ypos 562
         action Skip()
         
screen config_button:
     imagebutton:
         idle "Text/config.png"
         hover "Text/config2.png"
         xpos 700 ypos 562
         action ShowMenu("preferences")
And this goes in start:

Code: Select all

    show screen auto_button
    show screen skip_button
    show screen save_button
    show screen load_button
    show screen config_button
"It is [the writer's] privilege to help man endure by lifting his heart,
by reminding him of the courage and honor and hope and pride
and compassion and pity and sacrifice which have been the glory of his past."
— William Faulkner
▬▬▬▬▬▬▬▬▬▬..+X+..▬▬▬▬▬▬▬▬▬▬
Image

User avatar
backansi
Veteran
Posts: 224
Joined: Sun May 31, 2009 7:15 am
Location: Korea, Republic of
Contact:

Re: (noob)How to have buttons on your game? Not really image

#4 Post by backansi »

Kiri_Meow///
You may edit say screen using screen language.

Code: Select all


init:
    screen say:
        window id "window":
        has vbox

        if who:
            text who id "who"

        text what id "what"

        imagebutton 'status.png' action Jump('status') 
        imagebutton 'save.png' action ShowMenu('save')
        # .....
http://www.renpy.org/doc/html/screen_special.html#say
http://www.renpy.org/doc/html/screens.html#imagebutton

Kiri_Meow
Newbie
Posts: 5
Joined: Fri Dec 24, 2010 9:22 am
Contact:

Re: (noob)How to have buttons on your game? Not really image

#5 Post by Kiri_Meow »

OMG!!!!!!!! Thank you so much! :'D

I've been cracking my head just because of that code. LOL

I'll try to use those codes. ^^

@Sapphi: It worked!!!! THANK YOU THANK YOU THANK YOU!! :lol: :lol: :lol: :lol:
@backansi : Thanks for posting the link about the screens and stuff. :)

Post Reply

Who is online

Users browsing this forum: No registered users