style.window.background and layer order

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
npantic
Newbie
Posts: 2
Joined: Tue Jul 31, 2007 3:18 pm
Location: V. Gorica, Croatia
Contact:

style.window.background and layer order

#1 Post by npantic »

Is ti possible to change style.window.background on the go ? for example to change theme for some character or in some part of the game ?

Ho do you push an image in the front of text window ?

Thanks!

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: style.window.background and layer order

#2 Post by PyTom »

You can give Character a window_background argument, which specifies the background image that's used when that Character is shown.

What are you trying to do by putting an image above the window? I ask because there's multiple ways to do this, and I want to be sure you use the right one.
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

npantic
Newbie
Posts: 2
Joined: Tue Jul 31, 2007 3:18 pm
Location: V. Gorica, Croatia
Contact:

Re: style.window.background and layer order

#3 Post by npantic »

PyTom wrote:You can give Character a window_background argument, which specifies the background image that's used when that Character is shown..
No, i meant on text area... if i want to change the style (in my case - images) of area where text is shown, for example to have few types of it...

PyTom wrote: What are you trying to do by putting an image above the window? I ask because there's multiple ways to do this, and I want to be sure you use the right one.
for example, if in some action scene, i would like to put image (character or object) over the text area, to have a effect closing up...

tnx!

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: style.window.background and layer order

#4 Post by PyTom »

npantic wrote:No, i meant on text area... if i want to change the style (in my case - images) of area where text is shown, for example to have few types of it...
Yeah, that's what I thought you meant. The right way to do this is to define a window_background on the Character. That's the per interaction equivalent of style.window.background.

The dirty little secret of Ren'Py is that Character objects don't really represent characters, but rather collections of settings that are used when dialogue is shown.

PyTom wrote: for example, if in some action scene, i would like to put image (character or object) over the text area, to have a effect closing up...
This is probably a good candidate for the user of layers:

Code: Select all

init python:
    config.layers.append('ontop')

label test:
    show myimage onlayer ontop
    "The image is on top of this text!
    hide myimage onlayer ontop
    "Now it's gone!"
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: Ahrefs [Bot]