[Tutorial] Customizing the Textbox

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#76 Post by Alex »

You could make a semitrasparent color by setting it like "#rgba" where "a" is opacity

Code: Select all

style.window.background = Solid("#c009")
http://www.renpy.org/doc/html/displayables.html
http://www.renpy.org/doc/html/displayables.html#Solid

kirbysuperstar
Newbie
Posts: 10
Joined: Fri Jan 18, 2013 9:11 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#77 Post by kirbysuperstar »

Ahah, perfect. Thank you!

User avatar
Haika
Regular
Posts: 27
Joined: Sat Apr 19, 2014 10:02 pm
IRC Nick: Haika
Location: Indonesia
Contact:

Re: [Tutorial] Customizing the Textbox

#78 Post by Haika »

I have a problem. I want to change the padding and margin also the textbox minimum, but it keep error, why is that?

lemonokashi
Regular
Posts: 55
Joined: Mon Jan 13, 2014 11:46 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#79 Post by lemonokashi »

Sorry to be a total beginner, but how do you add save, load, or other buttons on the text box?

User avatar
Ilaine
Newbie
Posts: 9
Joined: Fri Mar 28, 2014 6:52 am
Contact:

Re: [Tutorial] Customizing the Textbox

#80 Post by Ilaine »

hi there, thank you very much for the tutorial but I've got a problem... I do not know why the namebox
isn't shown by me like in the tutorial I look at the option code and used yours for help but I still couldn't figure it out can anyone help me QQ? I am desprate OTL
Attachments
wrong.jpg
wrong.jpg (26.24 KiB) Viewed 2842 times

Ionait
Regular
Posts: 196
Joined: Wed Aug 26, 2009 5:54 pm
Organization: Chu! Bam! Pow!
Contact:

Re: [Tutorial] Customizing the Textbox

#81 Post by Ionait »

Hi! This tutorial is working great for me. I just have one question, particularly about using Shift+I to find the properties. I would like to change the font values for renpy.input. However, when I click Shift+I on the input screen, it just puts a capital I in the input box. xD

What is the correct label for renpy.input? Thank you so much!

User avatar
LRH
Regular
Posts: 42
Joined: Mon May 19, 2014 10:59 am
Contact:

Re: [Tutorial] Customizing the Textbox

#82 Post by LRH »

Ionait wrote:Hi! This tutorial is working great for me. I just have one question, particularly about using Shift+I to find the properties. I would like to change the font values for renpy.input. However, when I click Shift+I on the input screen, it just puts a capital I in the input box. xD

What is the correct label for renpy.input? Thank you so much!
style.input :)

Ionait
Regular
Posts: 196
Joined: Wed Aug 26, 2009 5:54 pm
Organization: Chu! Bam! Pow!
Contact:

Re: [Tutorial] Customizing the Textbox

#83 Post by Ionait »

LRH wrote:
Ionait wrote:Hi! This tutorial is working great for me. I just have one question, particularly about using Shift+I to find the properties. I would like to change the font values for renpy.input. However, when I click Shift+I on the input screen, it just puts a capital I in the input box. xD

What is the correct label for renpy.input? Thank you so much!
style.input :)
Thank you very much!

User avatar
LRH
Regular
Posts: 42
Joined: Mon May 19, 2014 10:59 am
Contact:

Re: [Tutorial] Customizing the Textbox

#84 Post by LRH »

Ionait wrote:Thank you very much!
You're welcome. I literally had just looked that up this morning for my own VNs :)

User avatar
Lady-Cynic
Regular
Posts: 104
Joined: Sun May 04, 2014 3:17 pm
Completed: Bobette: A KN that's horrible but at least complete
Projects: To Hell With Love: A G/G action game; Wendigo: A B/B horror game; Hannah's Humanity: A G/B KN about a girl making a choice; Counting Sheep: A mini RPG about a girl traveling with her sheep
Organization: Cynical Ghost Productions
IRC Nick: Lady-Cynic
Location: Chicago, IL
Contact:

Re: [Tutorial] Customizing the Textbox

#85 Post by Lady-Cynic »

Um, hi, I'm having a problem with my code for the text box. I did it exactly as the tutorial showed, but end up with this error:
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/options.rpy", line 99: expected 'word' not found.
style.window.background = "blue.png"
^

File "game/options.rpy", line 112: expected 'word' not found.
style.window.left_padding = 150
^

Ren'Py Version: Ren'Py 6.17.6.512
I'm not sure what "word" is supposed to be and I've tried everything. At first I thought it meant "Frame" but that got me an error as well. Here's my code; I hope you guys can help me.
style.window.background = "blue.png"

## Margin is space surrounding the window, where the background
## is not drawn.

style.window.left_margin = 6
style.window.right_margin = 6
style.window.top_margin = 6
style.window.bottom_margin = 6

## Padding is space inside the window, where the background is
## drawn.

style.window.left_padding = 150

# style.window.right_padding = 6
# style.window.top_padding = 6
# style.window.bottom_padding = 6

## This is the minimum height of the window, including the margins
## and padding.

style.window.yminimum = 578
Thanks for any help in advance!
Architect in training!
Cynical Ghost Productions
My commission thread.
BB's commission thread
My art thread~!
BButt's art thread
Help me go to college!
I prefer the pronouns xe, xem, xirself, etc., but what ever you use is cool with me.

User avatar
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#86 Post by sheetcakeghost »

In my experience an "expected 'anything' not found" warning means you didn't block the code like it thinks you should have. Is there an init: above the offending code? If so putting a block (tab space) in front of it could fix it. If there isn't you could try moving it to an area that has an init and making sure it's lined up with the other code there.

I've been noticing that 'word' not found has been popping up a lot with the new versions of ren'py. This tutorial is pretty old, and while the code should all work feasibly, it's going to cause hiccups in newer versions of the engine.

Keep in mind that I'm not a coder. Just thought you'd appreciate a quick answer that could give you a jumping point for your own troubleshooting.

User avatar
jellyRam
Newbie
Posts: 1
Joined: Mon Jun 23, 2014 5:45 am
Contact:

Re: [Tutorial] Customizing the Textbox

#87 Post by jellyRam »

Hey there, I´m a complete nood who´s just getting familiar with renpy and its coding, so each time I try to customize something things get complicated.. ;D
Anyway, the tutorial is really helpful and good written, but still I have a problem.

I created my own texbox ( and I think I´ve done everything that I was supposed to ;D), but still this error pops out:

Code: Select all

File "game/options.rpy", line 99: unexpected indent
        style.window.background = "textbox.png"
So, I´m not sure what went wrong. Here´s the whole code:

Code: Select all

 
     style.window.background = "textbox.png"

    ## Margin is space surrounding the window, where the background
    ## is not drawn.

     style.window.left_margin = 0
     style.window.right_margin = 0
     style.window.top_margin = 0
     style.window.bottom_margin = 0

    ## Padding is space inside the window, where the background is
    ## drawn.

     style.window.left_padding = 28
     style.window.right_padding = 30
     style.window.top_padding = 6
     style.window.bottom_padding = 44

    ## This is the minimum height of the window, including the margins
    ## and padding.

     style.window.yminimum = 184

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#88 Post by Alex »

"unexpected indent" means that your lines are indented differently from each other, see

Code: Select all

    ## Margin is space surrounding the window, where the background
    ## is not drawn.

     style.window.left_margin = 0
     style.window.right_margin = 0
- when you uncommenting lines you should delete not only #-symbol but also a space after it to make all the line to be indented identical.

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: [Tutorial] Customizing the Textbox

#89 Post by Kia »

I'm trying to align the name and text to the right side.
so far I got my basic like:
Image
and now I want to other character be like:
Image
and It's one of those flexible frames. tried all of align codes I could find but made no progress on aligning it to the right whatsoever.
any suggestion?

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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: [Tutorial] Customizing the Textbox

#90 Post by PyTom »

Perhaps try:

Code: Select all

style window:
    xfill False
    xalign 1.0
But this may not work if you're using show_two_window.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users