how to move gui text buttons

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
mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

how to move gui text buttons

#1 Post by mahyuringon »

how do you move this main menu text buttons into a single line horizontaly ?
menu1.png
menu2.png

into something like this?
for example
menu3.png

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

Re: how to move gui text buttons

#2 Post by Imperf3kt »

My internet won't load the images at the moment, but I can make two suggestions.
In the screen 'navigation', change all instances of "vbox" to "hbox"

Alternatively, use imagebuttons. You can position them with vboxes, hboxes, grids or xpos / ypos, etc.

Both of these methods will however, alter ALL screens. Its possible to do the menu only, and there's a few approaches, but I cannot go over them all at this time.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#3 Post by mahyuringon »

Imperf3kt wrote:My internet won't load the images at the moment, but I can make two suggestions.
In the screen 'navigation', change all instances of "vbox" to "hbox"

Alternatively, use imagebuttons. You can position them with vboxes, hboxes, grids or xpos / ypos, etc.

Both of these methods will however, alter ALL screens. Its possible to do the menu only, and there's a few approaches, but I cannot go over them all at this time.
i could wair for your suggestion i really need it please


thank you

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

Re: how to move gui text buttons

#4 Post by Imperf3kt »

Alright, I'll probably have time to go over it in about 2 to 3 hours.

In the meantime, could you either attach or PM me the "screens.rpy" file.
If you don't want to share it, then just copy the section with the man menu, game menu and navigation?

I'll edit it and explain what I did.

I can see via the images that you are using text buttons. The easiest method is to create a hbox and insert a grid, but I need to see how the rest of your navigation works in order to do so correctly.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#5 Post by mahyuringon »

Imperf3kt wrote:Alright, I'll probably have time to go over it in about 2 to 3 hours.

In the meantime, could you either attach or PM me the "screens.rpy" file.
If you don't want to share it, then just copy the section with the man menu, game menu and navigation?

I'll edit it and explain what I did.

I can see via the images that you are using text buttons. The easiest method is to create a hbox and insert a grid, but I need to see how the rest of your navigation works in order to do so correctly.

it works no i somehow found and fixed what i wanted fiddling and thingy..

now my problem is the background for the buttons..

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#6 Post by mahyuringon »

Imperf3kt wrote:Alright, I'll probably have time to go over it in about 2 to 3 hours.

In the meantime, could you either attach or PM me the "screens.rpy" file.
If you don't want to share it, then just copy the section with the man menu, game menu and navigation?

I'll edit it and explain what I did.

I can see via the images that you are using text buttons. The easiest method is to create a hbox and insert a grid, but I need to see how the rest of your navigation works in order to do so correctly.
but there are still things that i need to fix so ill attach it so you can see

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#7 Post by mahyuringon »

Imperf3kt wrote:Alright, I'll probably have time to go over it in about 2 to 3 hours.

In the meantime, could you either attach or PM me the "screens.rpy" file.
If you don't want to share it, then just copy the section with the man menu, game menu and navigation?

I'll edit it and explain what I did.

I can see via the images that you are using text buttons. The easiest method is to create a hbox and insert a grid, but I need to see how the rest of your navigation works in order to do so correctly.
memu.png
as you can see its on horizontal mode but its not allighned though...

how do i fix that?
memu1.png
on other menus too

here too
memu2.png
Attachments
screens.rpy
(37.91 KiB) Downloaded 79 times

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

Re: how to move gui text buttons

#8 Post by Imperf3kt »

You could use a grid.

Code: Select all

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

Current project: GGD Mentor

Twitter

jehu
Newbie
Posts: 3
Joined: Fri Apr 21, 2017 6:01 pm
Contact:

Re: how to move gui text buttons

#9 Post by jehu »

I'm having the same problems as mahyuringon, any chance you could expand on use a grid? where? how? or or point to a tutorial for the current version of renpy?

Ive spent 10+ hours trying to figure out how to move buttons and I'm starting to lose my mind...

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#10 Post by mahyuringon »

jehu wrote:I'm having the same problems as mahyuringon, any chance you could expand on use a grid? where? how? or or point to a tutorial for the current version of renpy?

Ive spent 10+ hours trying to figure out how to move buttons and I'm starting to lose my mind...
getting crazy here~

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#11 Post by mahyuringon »

Imperf3kt wrote:You could use a grid.

Code: Select all

grid 8 1:
    textbutton... etc
on which part would i place the grid?

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

Re: how to move gui text buttons

#12 Post by Imperf3kt »

Sorry, I was out all day and wasn't able to check the forums.

Place the grid in the navigation screen directly above your textbuttons.

So for example:

Code: Select all

screen navigation():
    style_prefix "navigation"
#create a grid that is 8 columns wide and 1 row high
    grid 8 1:
#position the grid
        xalign 0.5
        yalign 0.8
#for more info on positioning, follow this link https://www.renpy.org/doc/html/style_properties.html#position-style-properties

#place the options
        textbutton... etc

#define spacing
        spacing 25#replace 25 with the number of pixels gap you want between each option
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#13 Post by mahyuringon »

Imperf3kt wrote:Sorry, I was out all day and wasn't able to check the forums.

Place the grid in the navigation screen directly above your textbuttons.

So for example:

Code: Select all

screen navigation():
    style_prefix "navigation"
#create a grid that is 8 columns wide and 1 row high
    grid 8 1:
#position the grid
        xalign 0.5
        yalign 0.8
#for more info on positioning, follow this link https://www.renpy.org/doc/html/style_properties.html#position-style-properties

#place the options
        textbutton... etc

#define spacing
        spacing 25#replace 25 with the number of pixels gap you want between each option


it says grid expects a non- empty block...

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

Re: how to move gui text buttons

#14 Post by Imperf3kt »

I was going by the documentation, though I did think it was incorrect.

Alright, try adding a frame.

Code: Select all

screen navigation():
    style_prefix "navigation"
    frame:
        xalign 0.5
        yalign 0.8
        grid 8 1:

            textbutton... etc

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

Current project: GGD Mentor

Twitter

mahyuringon
Regular
Posts: 60
Joined: Tue Mar 21, 2017 11:10 pm
Contact:

Re: how to move gui text buttons

#15 Post by mahyuringon »

Imperf3kt wrote:I was going by the documentation, though I did think it was incorrect.

Alright, try adding a frame.

Code: Select all

screen navigation():
    style_prefix "navigation"
    frame:
        xalign 0.5
        yalign 0.8
        grid 8 1:

            textbutton... etc

            spacing 25

i cant seem to find where the Game menu is where the text thingis and put the code...

doing trial and error..

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Kocker, Majestic-12 [Bot], Semrush [Bot]