Adding Scroll to textbox?[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.
Post Reply
Message
Author
User avatar
DragonFire
Newbie
Posts: 5
Joined: Sun Jun 22, 2014 4:46 am
Contact:

Adding Scroll to textbox?[SOLVED]

#1 Post by DragonFire » Sun Jun 22, 2014 5:49 am

Hello :) I'm new here so please bear with me if I say something that is out of line.
[SOLVED]So, I was wondering, is there any way to change the background of the choice buttons on Ren'Py?
For example in the image below, (No, i'm not trying to plagiarize, I just couldn't find another example.) how can I change the blue background to that of an image (Like the one shown below.)?
Just the background and not the words.

[SOLVED]Also, is there any way for me to add a scroll in the text box as shown below? Like when I have a major load of text that I want to fit in one page but it is not big enough to fit into one text box. (Yes, I know I can just move the text to the next page but out of curiosity.)
I couldn't find any code for this in Ren'Py.

[SOLVED]I couldn't fit this into the title but how do you change the position of the buttons at the bottom right corner or Ren'Py? (Like the Q. Save, Q. Load etc.) I looked into the screens.rpy but the only code that I could find was:

Code: Select all

hbox:
        style_group "quick"

        xalign 1.0
        yalign 1.0

        textbutton _("Back") action Rollback()
        textbutton _("Save") action ShowMenu('save')
        textbutton _("Q.Save") action QuickSave()
        textbutton _("Q.Load") action QuickLoad()
        textbutton _("Skip") action Skip()
        textbutton _("F.Skip") action Skip(fast=True, confirm=True)
        textbutton _("Auto") action Preference("auto-forward", "toggle")
        textbutton _("Prefs") action ShowMenu('preferences')

init -2:
    style quick_button:
        is default
        background None
        xpadding 5

    style quick_button_text:
        is default
        size 12
        idle_color "#8888"
        hover_color "#ccc"
        selected_idle_color "#cc08"
        selected_hover_color "#cc0"
        insensitive_color "#4448"
Nothing about the positioning. :( Maybe I looked in the wrong place?

Thank you in advance for taking your time to read this. :)
Attachments
drawButton.png
drawButton.png (2.71 KiB) Viewed 2521 times
drawButton (1).png
drawButton (1).png (7.87 KiB) Viewed 2521 times
screenshot0001.png
Last edited by DragonFire on Mon Jun 23, 2014 9:49 am, edited 5 times in total.

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: Changing Background Of Buttons?Adding Scroll to textbox?

#2 Post by chocoberrie » Sun Jun 22, 2014 1:27 pm

With regards to changing the position of the quick menu (save, load, etc.), xalign and yalign are what you're looking for. It's right in the code you posted :) Change the numbers shown and that will change its position.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Changing Background Of Buttons?Adding Scroll to textbox?

#3 Post by PyTom » Sun Jun 22, 2014 3:31 pm

To change the background of a button, you want code like:

Code: Select all

style button:
    background Frame("drawButton (1).png", 3, 3)
    hover_background Frame("drawButton (2).png", 3, 3) 
Something like that, anyway. Check out the documentation of Frame to see what the parameters mean - they're basically the border size to use.

http://www.renpy.org/doc/html/displayables.html#Frame
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
DragonFire
Newbie
Posts: 5
Joined: Sun Jun 22, 2014 4:46 am
Contact:

Re: Changing Background Of Buttons?Adding Scroll to textbox?

#4 Post by DragonFire » Mon Jun 23, 2014 2:13 am

chocoberrie wrote:With regards to changing the position of the quick menu (save, load, etc.), xalign and yalign are what you're looking for. It's right in the code you posted :) Change the numbers shown and that will change its position.
I can't believe I didn't see that.
I'm so sorry~ Thanks loads! :D

@PyTom
Yeah! Got it to work. Thanks loads! :D

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Adding Scroll to textbox?

#5 Post by Asceai » Mon Jun 23, 2014 3:11 am

DragonFire wrote:Also, is there any way for me to add a scroll in the text box as shown below? Like when I have a major load of text that I want to fit in one page but it is not big enough to fit into one text box. (Yes, I know I can just move the text to the next page but out of curiosity.)
I couldn't find any code for this in Ren'Py.
Here's one way. Replace the default one-window textbox code in screens.rpy with this:

Code: Select all

        # The one window variant.
        window:
            id "window"
            has viewport
            draggable True
            mousewheel True
            scrollbars "vertical"
            ymaximum style.say_window.yminimum xfill True yfill True
            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"
Downside is that the scrollbar appears whether there's any need to scroll or not.

User avatar
DragonFire
Newbie
Posts: 5
Joined: Sun Jun 22, 2014 4:46 am
Contact:

Re: Adding Scroll to textbox?

#6 Post by DragonFire » Mon Jun 23, 2014 9:48 am

@Asceai
Got it. Thanks! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot]