Panel button screens with text?

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
017Bluefield
Regular
Posts: 87
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain Studio
Deviantart: playerzero17
itch: autumn-rain-studio
Contact:

Panel button screens with text?

#1 Post by 017Bluefield » Fri Sep 21, 2018 2:57 am

So I'm trying to make a screen for the player to select a storyline to follow. I'm aiming for it to look like a set of panels, kinda like in the ship UI in Warframe:
Not precisely, mind, but the alternative is a line of indistinguishable text that may or may not actually be seperate buttons. That's gonna confuse the player.

Here's the code I have so far for it:

Code: Select all

screen story_select():
    zorder 1

    frame:
        pass

    grid 3 2 style "story_select_menu":
        textbutton "Introduction" style "story_select_buttons":
            action NullAction()
        textbutton "\"1-2\"" style "story_select_buttons":
            action NullAction()
        textbutton "\"1-3\"" style "story_select_buttons":
            action NullAction()

        textbutton "{b}{i}Codex{/i}{/b}" style "story_select_buttons":
            action NullAction()
        textbutton "2-2" style "story_select_buttons":
            action NullAction()
        textbutton "{i}{b}Return{/b} to Main Menu{/i}" style "story_select_buttons":
            action NullAction()

style story_select_menu:
    font "fonts/SourceCodePro-Regular.ttf"
    align (0.5,0.5)
    xspacing 60
    yspacing 120

style story_select_buttons is story_select_menu:
    size 60

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

Re: Panel button screens with text?

#2 Post by Imperf3kt » Fri Sep 21, 2018 9:45 am

Was there more to your question? I can't really tell if you're having difficulties, or just sharing something, or require help or ran into an error or something else.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

017Bluefield
Regular
Posts: 87
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain Studio
Deviantart: playerzero17
itch: autumn-rain-studio
Contact:

Re: Panel button screens with text?

#3 Post by 017Bluefield » Fri Sep 21, 2018 9:05 pm

I'm trying to get scaleable panel-style buttons, not textbuttons. I'm not sure if I need imagebutton or just button.

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

Re: Panel button screens with text?

#4 Post by Imperf3kt » Sat Sep 22, 2018 4:14 am

You can achieve that with imagebuttons inside a vpgrid (or regular grid)
Or you can place frames in and style them and add a button.

I'd go with the first option, it's easier, but does add a few MB to your game.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

017Bluefield
Regular
Posts: 87
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain Studio
Deviantart: playerzero17
itch: autumn-rain-studio
Contact:

Re: Panel button screens with text?

#5 Post by 017Bluefield » Sat Sep 22, 2018 4:47 am

I'll try the first one first, then. But in the meantime, is there an "instruction manual" for Option #2?

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

Re: Panel button screens with text?

#6 Post by Imperf3kt » Sat Sep 22, 2018 5:58 pm

There is a gui customisation guide somewhere in the cookbook. Its for the old GUI, but most of it still applies, with minor changes.
It might help, but as far as I am aware, no guide exists and its not something I have done myself.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Post Reply

Who is online

Users browsing this forum: No registered users