This is coding shorthand.
-- It's used when the person trying to help us assumes that
we have the same (high) level of coding experience that
they do.
Code: Select all
screen say:
if who: ## if person
window:
[...]
else: ## if narrator
window:
[...]
There's a MUCH easier way to do this.
When you declare your characters on the first page of your script, you can also declare what textboxes you want to use for them too:
Code: Select all
# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
# The game starts here.
label start:
e "You've created a new Ren'Py game."
e "Once you add a story, pictures, and music, you can release it to the world!"
return
THIS is what you're going to play with.
Code: Select all
define e = Character('Eileen', color="#c8ffc8")
To declare an unnamed narrator box with a specific .png, add this:
Code: Select all
define narrator = Character(None,
window_background=Frame("textbox.png", 0, 0))
Just change
textbox.png to the .png of your choice -- and don't forget to
Leave In the indentation; the empty spaces.
You can do the same thing with individual characters too.
Code: Select all
define e = Character('Eileen',
color="#c8ffc8",
show_two_window = True,
window_background=Frame("textbox2.png", 0, 0))
NEVER forget to put a
comma behind everything you add.
If you only want a different box for your narrator, and plan to use the same box for
all your other characters, instead of changing all your character definitions, you can simply add this to your
options.rpy page:
Code: Select all
## Frame ------------------------
style.window.background = Frame("textbox.png", 0, 0)
## No Frame --------------------
# style.window.background = "textbox.png"
For far more fun with Textboxes, read
This Tutorial located in the Cookbook section of this forum.