Want my images, videos to appear in a particular size and place 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
Yuvan raj
Regular
Posts: 38
Joined: Wed Feb 17, 2021 11:24 am
Contact:

Want my images, videos to appear in a particular size and place on the screen!

#1 Post by Yuvan raj »

Hello, I'm trying to create a visual novel in which the displayables should only appear on a particular place and size on the screen. Like the picture below,
Image

I want my images to appear only inside the orange frame. Below and in the sides I want to create imagemaps for difference locations and such. My main content should only be inside the frame. How should I go about doing it? Thank you very much for your answeres in advance!

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Want my images, videos to appear in a particular size and place on the screen!

#2 Post by Ocelot »

You can create a separate layer for thise images and clip it to fit your need.

https://www.renpy.org/doc/html/config.h ... r_clipping
https://www.renpy.org/doc/html/config.h ... fig.layers
< < insert Rick Cook quote here > >

Yuvan raj
Regular
Posts: 38
Joined: Wed Feb 17, 2021 11:24 am
Contact:

Re: Want my images, videos to appear in a particular size and place on the screen!

#3 Post by Yuvan raj »

Ocelot wrote: Tue May 11, 2021 3:13 am You can create a separate layer for thise images and clip it to fit your need.

https://www.renpy.org/doc/html/config.h ... r_clipping
https://www.renpy.org/doc/html/config.h ... fig.layers
Thank you for the reply! I did as you comment and It works! but I have a problem right now. This is the result I'm getting using these codes.

Code: Select all

################################################-----Layers-----###################################################


define config.layers = [ 'master', 'transient', 'viewport' ,'screens', 'overlay' ]

define config.layer_clipping['viewport'] = (14, 14, 1536, 864)

################################################-----Layers-----###################################################
These are the results:
Image
and Image

I want my smaller images to be in the center of the layer. Both horizontally and vertically. Searching the net, I think I should create a frame and use borders. Is that the correct way? If yes, how should I use it?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Want my images, videos to appear in a particular size and place on the screen!

#4 Post by Ocelot »

How do you show these images? What positional arguments do you provide to them?
< < insert Rick Cook quote here > >

Yuvan raj
Regular
Posts: 38
Joined: Wed Feb 17, 2021 11:24 am
Contact:

Re: Want my images, videos to appear in a particular size and place on the screen!

#5 Post by Yuvan raj »

Ocelot wrote: Tue May 11, 2021 11:30 am How do you show these images? What positional arguments do you provide to them?
I typed this code in the options.rpy

Code: Select all

################################################-----Layers-----###################################################


define config.layers = [ 'master', 'transient', 'viewport' ,'screens', 'overlay' ]

define config.layer_clipping['viewport'] = (14, 14, 1536, 864)

################################################-----Layers-----###################################################
And then in script I typed:
show man_silhoutte onlayer viewport

Edit:
I can get the images to appear in the center of the layer using 'at truecenter'

show man_silhoutte at truecenter onlayer viewport.

This works, but wondering whether I can eliminate copy pasting 'at truecenter' by changing the layer's properties like 'borders'.
Also what if I want to edit the dimensions of the master layer itself?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Want my images, videos to appear in a particular size and place on the screen!

#6 Post by Ocelot »

You can replace config.default_transform variable to make everything appear at transform you want.
As for master layer, you can certainly crop it, but know that everything that usually gets placed on master layer would be affected by cropping.

https://www.renpy.org/doc/html/config.h ... _transform
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]