Button images?

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
Tomoya
Newbie
Posts: 24
Joined: Thu Jun 16, 2011 5:09 am
Completed: 0
Projects: Clannad - K.A.
Contact:

Button images?

#1 Post by Tomoya »

Hey guys. I just started ren'py about 2 days ago so I'm a noob :( and I was wondering how to make the main menu buttons have images and stuff...

Main Menu:
Image

I want the Start, Load game, Preferences, Help, & Quit to have an image.

I appreciate the help in advanced! :D

Kimiko
Regular
Posts: 52
Joined: Thu Feb 17, 2011 1:33 pm
Contact:

Re: Button images?

#2 Post by Kimiko »

You could use an imagemap.

Code: Select all

init -2 python:
    layout.imagemap_main_menu("Ground.jpg", "Hover.jpg", [
        (111, 248, 392 ,313, "Start Game"),
        (111, 313, 392, 378, "Load Game"),
        (48, 432, 237, 529, "Preferences"),
        (48,529,237,576, "Quit"),
        (48, 435, 237, 482, "Help"),
        ])
Image
I'm going to smile like nothing's wrong. Talk like everything's perfect, act like it’s all a dream and pretend it's not hurting me.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Button images?

#3 Post by Aleema »

At least some of those old imagemap layout codes are broken for newer Ren'Py versions. You should use imagemaps using Screen Language. Here's a tutorial.

Kimiko
Regular
Posts: 52
Joined: Thu Feb 17, 2011 1:33 pm
Contact:

Re: Button images?

#4 Post by Kimiko »

Aleema wrote:At least some of those old imagemap layout codes are broken for newer Ren'Py versions.
Really? oo' I'm using Ren'Py 6.12.1 and it works without any problems.
Image
I'm going to smile like nothing's wrong. Talk like everything's perfect, act like it’s all a dream and pretend it's not hurting me.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Button images?

#5 Post by Aleema »

I've personally encountered several problems (the navigation imagemap jumps to mind), but your mileage may vary.

Post Reply

Who is online

Users browsing this forum: Andredron, mold.FF