[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
Message
Author
Udar
Newbie
Posts: 4
Joined: Sun Mar 11, 2018 8:14 am
Contact:

[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
rayminator
Regular
Posts: 173
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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")
Image

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1614
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

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.
Image

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Taleweaver
Writing Maniac
Posts: 3425
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
Contact:

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

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

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: Alex, Baidu [Spider], MaydohMaydoh, tincrumbs