[Solved] Video positioning

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
Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

[Solved] Video positioning

#1 Post by Doeny »

I defined an .webm file as an image and resized it. Now I want to make it appear somewhere in the screen using "show image", but it seems "image my_image does not accept position attributes". Is there a way to do it without setting up a new scene?
Last edited by Doeny on Thu Oct 06, 2022 6:36 pm, edited 2 times in total.

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Video positioning

#2 Post by enaielei »

https://www.renpy.org/doc/html/movie.html#Movie wrote: Movie(fps=24, size=None, channel=u'movie', play=None, mask=None, mask_channel=None, image=None, play_callback=None, side_mask=False, loop=True, start_image=None, **properties)
The properties parameter here is probably the one you're looking for.

Code: Select all

image my_image = Movie(..., align=(0.5, 0.5)) # places the movie at the center
Another ways...

Code: Select all

image my_image = Movie(...)

label start:
    show my_image:
        align (0.5, 0.5)

Code: Select all

image my_image = Transform(Movie(...), align=(0.5, 0.5))

label start:
    show my_image

Code: Select all

transform my_trans():
    align (0.5, 0.5)

image my_image = Movie(...)

label start:
    show my_image at my_trans

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: Video positioning

#3 Post by Doeny »

enaielei wrote: Mon Oct 03, 2022 9:46 pm
https://www.renpy.org/doc/html/movie.html#Movie wrote: Movie(fps=24, size=None, channel=u'movie', play=None, mask=None, mask_channel=None, image=None, play_callback=None, side_mask=False, loop=True, start_image=None, **properties)
The properties parameter here is probably the one you're looking for.

Code: Select all

image my_image = Movie(..., align=(0.5, 0.5)) # places the movie at the center
Another ways...

Code: Select all

image my_image = Movie(...)

label start:
    show my_image:
        align (0.5, 0.5)

Code: Select all

image my_image = Transform(Movie(...), align=(0.5, 0.5))

label start:
    show my_image

Code: Select all

transform my_trans():
    align (0.5, 0.5)

image my_image = Movie(...)

label start:
    show my_image at my_trans
For some reason I'm getting an "expected 'image_name_component' not found" error. No idea what it means or is caused by.

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Video positioning

#4 Post by enaielei »

Maybe try avoiding using the "image" word itself in naming your image.
You can also post here your full traceback.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: Video positioning

#5 Post by Doeny »

enaielei wrote: Mon Oct 03, 2022 11:51 pm Maybe try avoiding using the "image" word itself in naming your image.
You can also post here your full traceback.
So here's that part of the code:

Code: Select all

label unit_1_deploy:
    $ unit_1_deployed = True
    if selected_tile == 1:
        $ tile_1 = True
        show "unit_chara"
        hide screen unit_list

And the traceback:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/field.rpy", line 171: expected 'image_name_component' not found.
    show "unit_chara"

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Video positioning

#6 Post by enaielei »

If you'll see the "show" example in my code, there are no quotes there.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: Video positioning

#7 Post by Doeny »

enaielei wrote: Tue Oct 04, 2022 12:12 am If you'll see the "show" example in my code, there are no quotes there.
Can't believe I fell into that. It works perfectly, thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot]