How to align scrollable images?

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
meat_punch
Newbie
Posts: 3
Joined: Sun Feb 21, 2021 11:50 am
Contact:

How to align scrollable images?

#1 Post by meat_punch »

Hello, when i making screens for my game, i had some problems.
버그.png
like this picture, it isn't aligned.
and i want to hide the top and bottom image in left in this picture.

I tried to find solution to this problem for a day,
but i couldn't find solution to this.

This is code.↓

screen allchats():
zorder 45
viewport id "allchat":
scrollbars
mousewheel True


add "smartphone/allchats.png"


#xalign 0.5
#yalign 0.7
# xalign 0.7
#yalign 0.5

cheonbyeol
Regular
Posts: 37
Joined: Thu Feb 04, 2021 9:04 am
Contact:

Re: How to align scrollable images?

#2 Post by cheonbyeol »

Could you specify more what you're trying to do?
What part do you want to align?
And what do you mean hide the images? Permanently, based on some conditions, etc.
Also the code definitely doesn't produce the whole screen you screenshotted, can you crop the image to the important part? Or if all is important, share more of the code?

meat_punch
Newbie
Posts: 3
Joined: Sun Feb 21, 2021 11:50 am
Contact:

Re: How to align scrollable images?

#3 Post by meat_punch »

almostbug.png
i want to align the image in the left to right like this picture

Code: Select all

screen allchats():
     zorder 45
     viewport id "allchat":
         scrollbars        
         mousewheel True

        
         add "smartphone/allchats.png"
↑this is the code of screen that i'm making.
the right screen of this picture is not important.

i want make this screen can scrolled in frame like a smart phone.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: How to align scrollable images?

#4 Post by hell_oh_world »

try giving an `xysize` to your viewport, this should be the size where this image is clipped (the size of the smartphone screen to be exact.)

meat_punch
Newbie
Posts: 3
Joined: Sun Feb 21, 2021 11:50 am
Contact:

Re: How to align scrollable images?

#5 Post by meat_punch »

It works! thank you

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Ocelot