Main Menu Buttons Question [SOLVED]

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.
Message
Author
User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Main Menu Buttons Question [SOLVED]

#16 Post by Aleema »

Well, since you said onegai ...

See the individual imagebutton codes?

Code: Select all

$ ui.imagebutton("newgame1.png", "newgame2.png", clicked=ui.returns("start"))
$ ui.imagebutton("loadgame1.png", "loadgame2.png", clicked=ui.returns("load"))
$ ui.imagebutton("options1.png", "options2.png", clicked=ui.returns("prefs"))
$ ui.imagebutton("exit1.png", "exit2.png", clicked=ui.returns("quit"))
That's 4 buttons. At the END of each button code, right before the ending parenthesis ")", you can put position properties.

Meaning, if you want the load game button to be slight more right than the other buttons you would say:

Code: Select all

$ ui.imagebutton("loadgame1.png", "loadgame2.png", clicked=ui.returns("load"), xpos=25)
I moved it over 25 pixels.

Get familiar with the phrases xpos, ypos, xanchor, and yanchor, and you can put things anywhere you want on screen.

User avatar
nash
Newbie
Posts: 20
Joined: Sat Jan 29, 2011 4:23 pm
Contact:

Re: Main Menu Buttons Question [SOLVED]

#17 Post by nash »

Aleema wrote:Well, since you said onegai ...

See the individual imagebutton codes?

Code: Select all

$ ui.imagebutton("newgame1.png", "newgame2.png", clicked=ui.returns("start"))
$ ui.imagebutton("loadgame1.png", "loadgame2.png", clicked=ui.returns("load"))
$ ui.imagebutton("options1.png", "options2.png", clicked=ui.returns("prefs"))
$ ui.imagebutton("exit1.png", "exit2.png", clicked=ui.returns("quit"))
That's 4 buttons. At the END of each button code, right before the ending parenthesis ")", you can put position properties.

Meaning, if you want the load game button to be slight more right than the other buttons you would say:

Code: Select all

$ ui.imagebutton("loadgame1.png", "loadgame2.png", clicked=ui.returns("load"), xpos=25)
I moved it over 25 pixels.

Get familiar with the phrases xpos, ypos, xanchor, and yanchor, and you can put things anywhere you want on screen.
Arigatou for fast answering =3 I will test it soon, thank you =)
1 Litre of Tears
Image

User avatar
nash
Newbie
Posts: 20
Joined: Sat Jan 29, 2011 4:23 pm
Contact:

Re: Main Menu Buttons Question [SOLVED]

#18 Post by nash »

Senpai, I have another problem. When I click, for example, on the Option-button I come to the Option-menu and then after I return, the main-menu shows me the old buttons with the old style. How can i prevent this disappear of my buttons? =3
1 Litre of Tears
Image

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Main Menu Buttons Question [SOLVED]

#19 Post by TheOneAndOnly-K »

Another question for this thread-

I've tried moving with the xpos=25 but it doesn't move and I still get errors D:

Post Reply

Who is online

Users browsing this forum: No registered users