Page 1 of 1

Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 2:14 am
by zeroTheHero
My code:

Code: Select all

show screen test_screen
    pause
    $renpy.transition(fade)
    hide screen test_screen 
    show screen hook 
    show text "{color=#000}{cps=10} When the world calls, I come.  I have come to save the world.{/color}{/cps}" onlayer over_screens 
    pause 
    hide text
    with dissolve
    $renpy.transition(pixellate)
    ...
I can't get the text to come off, even with hide text.
I think this is cuz of onlayer over_screens, but without it the text is hidden under screen hook and doesn't show up at all! How do I work through this?
Thanks!

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 2:32 am
by Imperf3kt
Change zorder of screen, perhaps.

Need more info about the shown screens and other stuff to say for sure.

Your code looks like it could improve, too. You might want to consider the on statement to fade screens when hidden.
Why isn't the text part of screen hook.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 3:55 am
by zeroTheHero
Imperf3kt wrote: Mon Jan 28, 2019 2:32 am Change zorder of screen, perhaps.

Need more info about the shown screens and other stuff to say for sure.

Your code looks like it could improve, too. You might want to consider the on statement to fade screens when hidden.
Why isn't the text part of screen hook.
I have already tried setting zorder to 1000, it doesn't work. Maybe I'm doing it wrong?

Code: Select all

show text "{color=#000}{cps=10} When the world calls, I come.  I have come to save the world.{/color}{/cps}" zorder 1000
The screen hook is a basic one

Code: Select all

screen hook:
    frame :
        add "bg1.png"
The screen above hook is a test screen and it's hidden, so I don't think it affects text.
Yes, I usually use with Transition(), I was testing $renpy.transition() here. How would 'on' work in this case though? I read the Transitions doc before but didn't really find it? (or maybe I didn't pay attention to it)
Thanks for the help!

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 4:18 am
by Imperf3kt
On works within a screen.
Here's an example demonstrating everything I was suggesting.

Code: Select all

default changing_text = "Fried Chicken" 
screen test_screen() :
    on Hide renpy.transition(fade) #may be an action

screen hook() :
    zorder 50
    image black
    # image black should be defined within renpy internals, no need to define it
    text "[changing_text]" 
    # use standard positioning arguments to align text, or place it in a container such as a vbox, fixed, grid, etc.
    
    on Hide renpy.transition(pixellate)
    
label start:
    show screen test_screen
    pause
    hide screen test_screen
    
    window hide
    show screen hook 
    $ changing_text = "{color=#000}{cps=10} When the world calls, I come. I have come to save the world.{/color}{/cps}"
    pause
    hide screen hook
    window auto
You could also "call" a screen so you don't need to use pause, but then you need a way to close the screen.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 6:22 am
by Wight
When it comes to onlayer, I noticed that you also have to mention what layer the thing you want to hide is on.
Because you have "text" set to "onlayer over_screens", instead of simply "hide text", it should now be

Code: Select all

hide text onlayer over_screens 
This should make it work and have the text disappear.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 8:48 am
by zeroTheHero
Imperf3kt wrote: Mon Jan 28, 2019 4:18 am On works within a screen.
Here's an example demonstrating everything I was suggesting.

Code: Select all

default changing_text = "Fried Chicken" 
screen test_screen() :
    on Hide renpy.transition(fade) #may be an action

screen hook() :
    zorder 50
    image black
    # image black should be defined within renpy internals, no need to define it
    text "[changing_text]" 
    # use standard positioning arguments to align text, or place it in a container such as a vbox, fixed, grid, etc.
    
    on Hide renpy.transition(pixellate)
    
label start:
    show screen test_screen
    pause
    hide screen test_screen
    
    window hide
    show screen hook 
    $ changing_text = "{color=#000}{cps=10} When the world calls, I come. I have come to save the world.{/color}{/cps}"
    pause
    hide screen hook
    window auto
You could also "call" a screen so you don't need to use pause, but then you need a way to close the screen.
Cool, I'll try it out!
PS what does 'image black should be defined within renpy internals, no need to define it' mean? I should define it outside of the screen? Or is it already defined by renpy?

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Mon Jan 28, 2019 9:23 am
by Imperf3kt
That was a comment explaining why you don't need to define "image black" - it's already defined.

Oh and I haven't actually tested that code, so it might have some minor errors.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Wed Jan 30, 2019 9:46 am
by zeroTheHero
Imperf3kt wrote: Mon Jan 28, 2019 9:23 am That was a comment explaining why you don't need to define "image black" - it's already defined.

Oh and I haven't actually tested that code, so it might have some minor errors.
Hey, so I tried it today but I get an error " u'renpy' is not a keyword argument or valid child for the on statement.
on Hide renpy.transition(fade)
[/code]

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Wed Jan 30, 2019 2:32 pm
by Imperf3kt
Okay, it mustn't like renpy.transition(pixellate)
Remove the renpy. part, you may have to capitalise transition.
Note it's in the code twice.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Wed Jan 30, 2019 11:06 pm
by zeroTheHero
Imperf3kt wrote: Wed Jan 30, 2019 2:32 pm Okay, it mustn't like renpy.transition(pixellate)
Remove the renpy. part, you may have to capitalise transition.
Note it's in the code twice.
Sorry but I can't get it to work... I tried all these combinations of capital/small letters, I still get the errors.

Code: Select all

on Hide Transition(Fade(0.5, 0, 0.5))
#on Hide Transition(fade)
on Hide Transition(Pixellate())

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Thu Jan 31, 2019 2:31 am
by zeroTheHero
Wight wrote: Mon Jan 28, 2019 6:22 am When it comes to onlayer, I noticed that you also have to mention what layer the thing you want to hide is on.
Because you have "text" set to "onlayer over_screens", instead of simply "hide text", it should now be

Code: Select all

hide text onlayer over_screens 
This should make it work and have the text disappear.
Wow I completely missed your post! This works!! In retrospect, this seems so common sense, just like everything in programming is XD. Thanks m8 ^_^

@Imperfekt I'd still love to see how to get 'on' working, I remember trying to get it to work before too but it gave me the same errors, getting over this would help a lot in making transitions. Also, thanks for taking the time to help! I'd be so lost without you guys here on lemma XD

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Thu Jan 31, 2019 2:56 am
by Imperf3kt
I think I gave bad advice, I'll review the code later when I get a chance, I see now where I went wrong, but currently haven't got the time to write up a proper example.

Re: Can't get text to show on top of a screen, and when I do it doesn't come off

Posted: Thu Jan 31, 2019 5:20 am
by zeroTheHero
Imperf3kt wrote: Thu Jan 31, 2019 2:56 am I think I gave bad advice, I'll review the code later when I get a chance, I see now where I went wrong, but currently haven't got the time to write up a proper example.
It's okay, at least my problem's solved :) Have a great day