Non-changing background and/or foreground

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
amfest
Newbie
Posts: 5
Joined: Fri Aug 04, 2006 9:04 pm
Location: Texas
Contact:

Non-changing background and/or foreground

#1 Post by amfest »

Something like this

Image

where the image is displayed at the top or center with a grahpical background that becomes the textbox itself and never disappears so no need of a box coming and going. I notiched when menu choices would come up the box would go away. A foreground image would also be nice like on the side if the res is smaller the branches would actually go over the image that changes without being affected. I like the way you can easily write out a story without much effort and I've been jumping from game maker to game maker to try and find something easy to use ..but when it comes to trying to figure out things of this nature my head spins @_@. I'll keep looking at the Docs and searching through the forums but I'm not really sure on the right term to use for it :/ I've always been bad at searching through forums :( Though with so many deadends I did find alot of interesting posts that had some nice information. Too bad it wasn't what I was looking for :( Any help much appreciated ^^

EDIT oh yea I noticed when I put an image in on scene or image it falls to the bottom .. I guess that's cause of characters and such but is there a way to position them more to the top or bottom or do I have to edit images to have a transparent bottom of pixels to align it to the top of game window instead? Which works . and I don't mind doing it but if I can simply tell the engine to place all images within this area instead . .I'd rather do it that way :D
Aria: *kusu*

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:

#2 Post by PyTom »

I'm not sure there was a question in there, but I will answer anyway.

The first thing you'll want to do is to get rid of the text window background. You can do this by setting style.window.background to None, by writing:

Code: Select all

init:
     $ style.window.background = None
You can then show two images, a background and an overlay, using code like:

Code: Select all

scene bg mybackground
show overlay
Where overlay is an image with a transparent "hole" in it, to let the background show through.

To put the character in the right spot, you'd want to define a position. I'd define something like mycenter:

Code: Select all

init:
     $ mycenter = Position(xpos=0.5, xanchor=0.5, yanchor=1.0, ypos=450)
This positions an image such that the center of the image is centered horizontally, and the bottom of the character is placed on the 450th line of the screen.

Use this like:

Code: Select all

show eileen happy at mycenter
Hope this helps.
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

amfest
Newbie
Posts: 5
Joined: Fri Aug 04, 2006 9:04 pm
Location: Texas
Contact:

#3 Post by amfest »

thanks alot ..I'll give it a shot.

Oops yea I guess I didn't add in "I'd like to have something like this can anyone help?"

thanks ago for the fast response
Aria: *kusu*

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#4 Post by monele »

PyTom : Done this way, won't the overlay disappear anytime there's a scene change ? Isn't it the perfect case to use the overlay layer ? (well, if that one doesn't get cleared at scene statements >.>...)

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:

#5 Post by PyTom »

It would, so you'd have to add it back in again.

I was trying to avoid the user of layers. You couldn't use overlay, which is cleared for each interaction... You'd have to define your own layer.
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

amfest
Newbie
Posts: 5
Joined: Fri Aug 04, 2006 9:04 pm
Location: Texas
Contact:

#6 Post by amfest »

Well I couldn't get the show overlay thing to work that way unless I was suppose to add something else >_> but I did run overlay through the forum search and found this to use from something you had mentioned before

Code: Select all

python:
        def overlay_func():
            ui.image("overlay.png")
        config.overlay_functions = [ overlay_func ] 
well ui.text to ui.image and it seemed to work though the dialog text didn't seem to appear over it so I had to cut the bottom half of it and adjust it to bg. the alignment thing worked out great thanks for that ^^
Aria: *kusu*

Post Reply

Who is online

Users browsing this forum: Bing [Bot]