Ren'Py Can someone help me with screen? (SOLVED)

Dimss99

Newbie
Jun 12, 2018
15
13
Thank-you for entering.

I think my problem is stupid and easy to solve.

I have simple code.

You don't have permission to view the spoiler content. Log in or register now.

Thank I'm pressing any button, there is black screen flash for a second... How can I fix it?

Thank-you.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,974
16,229
Thank I'm pressing any button, there is black screen flash for a second... How can I fix it?
Strictly speaking you can't. It's the time needed by Ren'Py to proceed everything and load the video.

What you can do is don't force Ren'Py to uselessly spend time. This can be done by both creating the video object beforehand, and not forcing Ren'Py to resize it. And also rely on the "start_image" property, to have an image displayed in place of the blank background screen, the time the video is loaded.

Python:
image runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
image runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
image runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
image runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
  
screen animation_main:

    modal True
  
    default speed = 1

    add ( "runing_man{}".format( speed ) )

    hbox:
        align 0.98 , 0.8
        text "Speed:" xalign 0.5 yalign 0.5
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5   # a horizontal display with all buttons having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 1)
            selected  speed == 1
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5 # a horizontal display with all button having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 2)
            selected  speed == 2
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5 # a horizontal display with all button having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 3)
            selected  speed == 3

Edit: typo.
 
Last edited:
  • Like
Reactions: Dimss99

Dimss99

Newbie
Jun 12, 2018
15
13
Strictly speaking you can't. It's the time needed by Ren'Py to proceed everything and load the video.

What you can do is don't force Ren'Py to uselessly spend time. This can be done by both creating the video object beforehand, and not forcing Ren'Py to resize it. And also rely on the "start_image" property, to have an image displayed in place of the blank background screen, the time the video is loaded.

Python:
define runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
define runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
define runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
define runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
  
screen animation_main:

    modal True
  
    default speed = 1

    add ( "runing_man{}".format( speed ) )

    hbox:
        align 0.98 , 0.8
        text "Speed:" xalign 0.5 yalign 0.5
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5   # a horizontal display with all buttons having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 1)
            selected  speed == 1
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5 # a horizontal display with all button having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 2)
            selected  speed == 2
        imagebutton:
            auto "/images/icons/button_%s.png"
            xalign 0.5 # a horizontal display with all button having the same horizontal alignment ? :/
            focus_mask True
            action SetScreenVariable("speed", 3)
            selected  speed == 3
Thank's I will try it :)
 

Dimss99

Newbie
Jun 12, 2018
15
13
runing_man{}
Thank's I will try it :)
Hmm it didnt work...
If i link it directly

Python:
define runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
define runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
define runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
define runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
 
screen animation_main:

    modal True
 
    default speed = 1
   
    image runing_man1 # Like that.

    add ( "runing_man{}".format( speed ) )
works perfect, but with " .format" He always complaining about "Image "runing_man1" not found."
Oh and buttons works... He always complaining about different variable.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,974
16,229
He always complaining about "Image "runing_man1" not found."
Well, if you add something totally useless and, at most, totally out dated, I'm not responsible for the errors you can get. But if you use the code I gave, as I gave it, it will works.
 

Dimss99

Newbie
Jun 12, 2018
15
13
Well, if you add something totally useless and, at most, totally out dated, I'm not responsible for the errors you can get. But if you use the code I gave, as I gave it, it will works.
I start new project and put in only your code... =/
I don't change anything, only add "label start"
I have ren'py 8.0.3 (recommended)

Sorry if I don't understand something... I super novice in Ren'py...
and thank-you for patience.

You don't have permission to view the spoiler content. Log in or register now.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,974
16,229
Sorry if I don't understand something...
It's not you, it's me.
I misunderstood when you talked about "image 'runing_man1' not found", thinking about the image running_man you had in your initial code. And like I had a [beeeep] hard week, I missed the error in my own code. I defined the movies as variable, not as images... grrrr...


Replace:
Python:
define runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
define runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
define runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
define runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
by:
Python:
image runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
image runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
image runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
image runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
And of course, replace the "whatever is relevant here" by the name of a relevant image, as said by the documentation:
"start_image
An image that is displayed when playback has started, but the first frame has not yet been decoded."

Generally the image to use match the first frame of the movie, this permit a softer transition.
 
  • Like
Reactions: Dimss99

Dimss99

Newbie
Jun 12, 2018
15
13
It's not you, it's me.
I misunderstood when you talked about "image 'runing_man1' not found", thinking about the image running_man you had in your initial code. And like I had a [beeeep] hard week, I missed the error in my own code. I defined the movies as variable, not as images... grrrr...


Replace:
Python:
define runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
define runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
define runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
define runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
by:
Python:
image runing_man1 = Movie( play="videos/run_1.ogv", start_image="whatever is relevant here" )
image runing_man2 = Movie( play="videos/run_2.ogv", start_image="whatever is relevant here" )
image runing_man3 = Movie( play="videos/run_3.ogv", start_image="whatever is relevant here" )
image runing_man4 = Movie( play="videos/finish.ogv", start_image="whatever is relevant here" )
And of course, replace the "whatever is relevant here" by the name of a relevant image, as said by the documentation:
"start_image
An image that is displayed when playback has started, but the first frame has not yet been decoded."

Generally the image to use match the first frame of the movie, this permit a softer transition.
I already understand and use "start_image"in my code variation.
And yeah everything works fine.
Steel that micro-freeze, but thanks to "start_image" it looks better. :)

Big Thank-you! :)