[SOLVED] How to create permanent image on the screen?

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
Jarly
Newbie
Posts: 4
Joined: Wed Jun 26, 2019 8:27 am
Contact:

[SOLVED] How to create permanent image on the screen?

#1 Post by Jarly » Wed Jun 26, 2019 9:11 am

Good day, everyone.
I wanted that certain image was on the screen all the time. For example, it shouldn't be affected by any transitions. I tried to use "ShowingSwitch" with "None" condition, but image has gone after wipe transition.
Any tips?
Last edited by Jarly on Wed Jun 26, 2019 6:27 pm, edited 1 time in total.

drKlauz
Regular
Posts: 168
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: How to create permanent image on the screen?

#2 Post by drKlauz » Wed Jun 26, 2019 9:42 am

Something like?

Code: Select all

default chapter_icon=None

screen chapter_icon:
  if chapter_icon is not None:
    add chapter_icon align (0.95,0.05)

label start:
  ...
  show screen chapter_icon
  ...

label chapter_1_start:
  $chapter_icon='chapter1_icon.png'
  ...

label chapter_2_start:
  $chapter_icon='chapter2_icon.png'
  ...

Jarly
Newbie
Posts: 4
Joined: Wed Jun 26, 2019 8:27 am
Contact:

Re: How to create permanent image on the screen?

#3 Post by Jarly » Wed Jun 26, 2019 4:38 pm

Thanks, that works mostly fine.
But it's still affected by transition like this:

Code: Select all

define fadeslow = Fade(1.5, 1.0, 1.5, color="#fff")
...
label start:
...
    scene bg cafe dusk
    with fadeslow
Image turns white with the rest of the screen.
Any methods to avoid this?

drKlauz
Regular
Posts: 168
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: How to create permanent image on the screen?

#4 Post by drKlauz » Wed Jun 26, 2019 5:34 pm

Maybe putting screen on different layer.

drKlauz
Regular
Posts: 168
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: How to create permanent image on the screen?

#5 Post by drKlauz » Wed Jun 26, 2019 5:51 pm

Code: Select all

define fadeslow = Fade(1.5, 1.0, 1.5, color="#fff")

init python:
  config.top_layers.append('marker')

screen marker:
  layer 'marker'
  add 'marker.png'

label start:
  show screen marker
  'start'
  scene bg cafe dusk
  with fadeslow
  'end'
  return
This works, but marker screen stays above yes/no confirmation screen, so you may want to rework it too.

Jarly
Newbie
Posts: 4
Joined: Wed Jun 26, 2019 8:27 am
Contact:

Re: How to create permanent image on the screen?

#6 Post by Jarly » Wed Jun 26, 2019 6:26 pm

Okay, that was a good advice. Actually, I missed completely documentation part about layers.
Code like this works perfectly:

Code: Select all

define config.top_layers = [ 'toplayer' ]
image logo1 = Image("logo.png", xalign=0.95, yalign=0.05)
...
label start:
...
    show logo1 onlayer toplayer
Many thanks.

drKlauz
Regular
Posts: 168
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: How to create permanent image on the screen?

#7 Post by drKlauz » Wed Jun 26, 2019 6:28 pm

Or this way :D Guess i'm sometimes get into over-engineering stuff.

Jarly
Newbie
Posts: 4
Joined: Wed Jun 26, 2019 8:27 am
Contact:

Re: [SOLVED] How to create permanent image on the screen?

#8 Post by Jarly » Wed Jun 26, 2019 6:38 pm

drKlauz wrote:
Wed Jun 26, 2019 5:51 pm
marker screen stays above yes/no confirmation screen
This isn't a problem. Actually, I wanted that text screen was permanent (probably should say that right away, but I somehow forgot about text part and concentrate at "background image" part :o ). It didn't have any overlaps with yes/no screen anyway.
So actual code looks just like this and works perfectly:

Code: Select all

define config.top_layers = [ 'toplayer' ]
define config.say_layer = "toplayer"

Post Reply

Who is online

Users browsing this forum: Google [Bot], Nikel