[SOLVED]PNG buttons instead of textbox button

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
Posts: 4
Joined: Sun Mar 11, 2018 8:14 am

[SOLVED]PNG buttons instead of textbox button

#1 Post by Udar » Fri Mar 16, 2018 12:00 pm

Hello there guys.

I'm in quite a pickle.These days I've been searching for a way to replace my project's main menu textbox buttons with my own handmade PNG ones. The thing is... I'm not sure how to do this replacement. Maybe someone can give me some hints about this, or a solution.
Thanks in advance!
Last edited by Udar on Sat Mar 17, 2018 10:09 am, edited 1 time in total.

User avatar
Posts: 445
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada

Re: PNG buttons instead of textbox button

#2 Post by rayminator » Fri Mar 16, 2018 2:37 pm

you would have to use imagebuttons instead of textbuttons

only an example:

Code: Select all

imagebutton idle im.Scale("gui/button/button_config.png", 129, 25) xpos 1100 ypos 550 hover im.Scale("gui/button/button_config(1).png", 129, 25) action ShowMenu('preferences')
            imagebutton idle im.Scale("gui/button/button_logs.png", 129, 25) xpos 973 ypos 579 hover im.Scale("gui/button/button_load(4).png", 129, 25) action ShowMenu('history')
            imagebutton idle im.Scale("gui/button/button_save(3).png", 129, 25) xpos 848 ypos 604 hover im.Scale("gui/button/button_save(4).png", 129, 25) action ShowMenu('save')
            imagebutton idle im.Scale("gui/button/button_load(3).png", 127, 25) xpos 723 ypos 629 hover im.Scale("gui/button/button_load(5).png", 127, 25) action ShowMenu("load")
when I try to help someone I point them into 2 direction what's right and wrong so they can learn how to

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

Re: PNG buttons instead of textbox button

#3 Post by Imperf3kt » Fri Mar 16, 2018 5:47 pm

Just so its a bit clearer (you should really look at the documentation for imagebuttons to learn how to position them and their various functions / attributes), here is the _minimum_ you would need for an imagebutton.

imagebutton auto "my_image_%s.png" action ShowMenu('save')

In addition you would require two images, located in the images folder - my_image_idle.png and my_image_hover.png
Last edited by Imperf3kt on Fri Mar 16, 2018 10:10 pm, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany

Re: PNG buttons instead of textbox button

#4 Post by Taleweaver » Fri Mar 16, 2018 6:36 pm

Moved to Ren'Py questions.
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

Posts: 4
Joined: Sun Mar 11, 2018 8:14 am

Re: PNG buttons instead of textbox button

#5 Post by Udar » Sat Mar 17, 2018 10:09 am

Thx guys,thx a lot

Post Reply

Who is online

Users browsing this forum: Google [Bot], nananame, pfranzen, trooper6