[SOLVED] Buttons on dialogue box?

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
Jintii
Newbie
Posts: 9
Joined: Sat Feb 14, 2015 8:08 pm
Completed: Programme 404
Projects: Absolute Divination
Tumblr: jintii
Deviantart: jintii
Contact:

[SOLVED] Buttons on dialogue box?

#1 Post by Jintii »

Basically, I want to make the hardly visible "textbutton"s which were "Back" "Save" "Pref" "Skip" etc etc

Image

into image buttons like below:

Image

I've been looking for a way to do so but to no avail ;____; Is there a way to do this?
Also, I'm rather new to ren'py so I apologize in advance if I don't understand anything aaaaaa /////
Last edited by Jintii on Sun Feb 15, 2015 4:33 pm, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Buttons on dialogue box?

#2 Post by trooper6 »

Certainly doable.

Check out the Imagebutton tutorial in the cookbook.
http://lemmasoft.renai.us/forums/viewto ... 51&t=22565
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Jintii
Newbie
Posts: 9
Joined: Sat Feb 14, 2015 8:08 pm
Completed: Programme 404
Projects: Absolute Divination
Tumblr: jintii
Deviantart: jintii
Contact:

Re: Buttons on dialogue box?

#3 Post by Jintii »

Ahhh, I downloaded that file and tried fiddling around with it, but I can't understand it /____\

User avatar
shivanshs9
Regular
Posts: 54
Joined: Sun Jul 20, 2014 1:59 pm
Projects: The Destiny(http://thedestiny-cxz.blogspot.com)
Organization: Cyber-X-Zone
Location: India
Contact:

Re: Buttons on dialogue box?

#4 Post by shivanshs9 »

Well, yeah, even though there were proper comments in the script, it still is a bit confusing...
So, what you want to understand is the code in "quick_menu3" in screens.rpy in the game directory...
Here's what is in it:

Code: Select all

screen quick_menu3:
    imagebutton auto "gui/quick_config_%s.png" action ShowMenu('preferences') xpos 690 ypos 390 focus_mask True
    imagebutton auto "gui/quick_save_%s.png" action ShowMenu('save') xpos 760 ypos 390 focus_mask True
    imagebutton auto "gui/quick_load_%s.png"action ShowMenu('load') xpos 830 ypos 390 focus_mask True
    imagebutton auto "gui/quick_main_%s.png" action MainMenu() xpos 900 ypos 390 focus_mask True
As explained here, 'imagebutton' can be used to create image-based buttons in a screen. For more fun explanation, play the Imagebutton GUI sample game!
But, basically what you want to do is to just replace the 'quick_menu' screen code in your game's screens.rpy with the code I quoted from the Imagebutton GUI sample game's screens.rpy... As for the function of auto and how to place images in the folder, I will suggest to read the imagebutton documentation...
"Destiny is a no matter of chance
It is a matter of choice
It is not a thing to be waited for
It is a thing to be achieved..."

-William Jennings Bryan
If you can dream and not make dreams your master;
If you can think and not make thoughts your aim,
If you can meet with Triumph and Disaster;
And treat those two impostors just the same,
Only then can you ever win against yourself...

User avatar
Jintii
Newbie
Posts: 9
Joined: Sat Feb 14, 2015 8:08 pm
Completed: Programme 404
Projects: Absolute Divination
Tumblr: jintii
Deviantart: jintii
Contact:

Re: Buttons on dialogue box?

#5 Post by Jintii »

@shivanshs9
ahhh it makes a lot more sense now! Thanks for the help uvu!!

User avatar
Jintii
Newbie
Posts: 9
Joined: Sat Feb 14, 2015 8:08 pm
Completed: Programme 404
Projects: Absolute Divination
Tumblr: jintii
Deviantart: jintii
Contact:

Re: Buttons on dialogue box?

#6 Post by Jintii »

I tried fiddling with the code just now, but an error keeps popping up like so:

Code: Select all

  File "game/screens.rpy", line 9, in execute
    screen say:
  File "game/screens.rpy", line 58, in execute
    use quick_menu
  File "game/screens.rpy", line 529, in execute
    screen quick_menu:
  File "game/screens.rpy", line 530, in execute
    imagebutton auto "Icons/settings_%s.png" action ShowMenu('preferences') xpos 600 ypos 450 focus_mask True
Exception: Not a displayable: None
is there a way to fix it? orz;;

User avatar
shivanshs9
Regular
Posts: 54
Joined: Sun Jul 20, 2014 1:59 pm
Projects: The Destiny(http://thedestiny-cxz.blogspot.com)
Organization: Cyber-X-Zone
Location: India
Contact:

Re: [SOLVED] Buttons on dialogue box?

#7 Post by shivanshs9 »

Well, there should be images named "settings_idle.png", "settings_hover.png" etc in the Icons folder, inside the game directory, too... The error must be showing because it can't find the idle image and so can't show the image...
DETAILS: http://renpy.org/doc/html/screens.html#imagebutton
"Destiny is a no matter of chance
It is a matter of choice
It is not a thing to be waited for
It is a thing to be achieved..."

-William Jennings Bryan
If you can dream and not make dreams your master;
If you can think and not make thoughts your aim,
If you can meet with Triumph and Disaster;
And treat those two impostors just the same,
Only then can you ever win against yourself...

Post Reply

Who is online

Users browsing this forum: No registered users