Page 1 of 1

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

Posted: Tue May 11, 2021 3:06 am
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!

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

Posted: Tue May 11, 2021 3:13 am
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

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

Posted: Tue May 11, 2021 11:27 am
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?

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

Posted: Tue May 11, 2021 11:30 am
by Ocelot
How do you show these images? What positional arguments do you provide to them?

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

Posted: Tue May 11, 2021 1:43 pm
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?

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

Posted: Tue May 11, 2021 1:51 pm
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