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.
Yuvan raj
Regular
Posts: 38 Joined: Wed Feb 17, 2021 11:24 am
Contact:
#1
Post
by Yuvan raj » Sun May 23, 2021 4:08 am
Hello, my viewport scrolling area is too long! The Thumb is very small and it just goes down so long. I have attached a picture of my problem and the code I use. I only want to show these 7 pictures now and maximum 15 pictures later. How to make my viewport to only go down till my last element that I put inside? Thank you in advance!
Code: Select all
screen charactersbutton():
modal True
frame:
background Solid("#5a5c5c")
xpos 20 ypos 18
xmaximum 1468
xminimum 1468
ymaximum 1045
yminimum 1045
viewport:
scrollbars "vertical"
mousewheel True
draggable True
xalign 0.5
hbox:
imagebutton auto "close_%s" xpos 1150 ypos 8 action [Hide("charactersbutton"), SetVariable("characters_imagebutton_list_boolean",True)]:
at transform:
zoom 0.2
Last edited by
Yuvan raj on Sun May 23, 2021 12:41 pm, edited 1 time in total.
Alex
Lemma-Class Veteran
Posts: 3090 Joined: Fri Dec 11, 2009 5:25 pm
Contact:
#2
Post
by Alex » Sun May 23, 2021 5:20 am
This is the code for close-button, and wat about all other images inside a viewport?
Also, try to play with the size of the frame
Code: Select all
frame:
background Solid("#5a5c5c")
xpos 20 ypos 18
xmaximum 1468
xminimum 1468
ymaximum 1045
yminimum 1045
(check the part with 'area' in sample code -
https://www.renpy.org/doc/html/screens.html#viewport )
Remix
Eileen-Class Veteran
Posts: 1628 Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:
#3
Post
by Remix » Sun May 23, 2021 5:37 am
You have not shown the part of the code that has the images... It is likely that those are what is making the viewport content so large.
Yuvan raj
Regular
Posts: 38 Joined: Wed Feb 17, 2021 11:24 am
Contact:
#4
Post
by Yuvan raj » Sun May 23, 2021 6:22 am
Alex wrote: ↑ Sun May 23, 2021 5:20 am
This is the code for close-button, and wat about all other images inside a viewport?
Also, try to play with the size of the frame
Code: Select all
frame:
background Solid("#5a5c5c")
xpos 20 ypos 18
xmaximum 1468
xminimum 1468
ymaximum 1045
yminimum 1045
(check the part with 'area' in sample code -
https://www.renpy.org/doc/html/screens.html#viewport )
Remix wrote: ↑ Sun May 23, 2021 5:37 am
You have not shown the part of the code that has the images... It is likely that those are what is making the viewport content so large.
This is my code, and yes now that you guys mention it. The images are VERY big. I'll probably reduce its original size and format when I release the game but for now I used the transform 'zoom' statement to reduce it's size. Below this code is the size of the original picture without zoom statement.
Code: Select all
vbox:
spacing 30
xalign 0.5
hbox:
spacing 30
imagebutton idle "images/status_images/characters/1 character.png" action [SetVariable("characters_imagebutton_list_boolean", False), SetVariable("first_character_imagebutton", True), Hide("charactersbuttonlist")]
imagebutton idle "images/status_images/characters/2 character.png" action NullAction():
at transform:
zoom 0.30
imagebutton idle "images/status_images/characters/3 character.png" action NullAction():
at transform:
zoom 0.30
hbox:
spacing 30
imagebutton idle "images/status_images/characters/4 character.png" action NullAction():
at transform:
zoom 0.30
imagebutton idle "images/status_images/characters/5 character.png" action NullAction():
at transform:
zoom 0.30
imagebutton idle "images/status_images/characters/6 character.png" action NullAction():
at transform:
zoom 0.30
And this is the original size of pics used
Is there a way to reduce the scrollbar vertical area without decreasing the images used in viewport's size? Is there no other way to reduce the viewport size other than resizing the images?
Alex
Lemma-Class Veteran
Posts: 3090 Joined: Fri Dec 11, 2009 5:25 pm
Contact:
#5
Post
by Alex » Sun May 23, 2021 6:44 am
Try to declare all images, like
Code: Select all
image button_1_idle:
"images/status_images/characters/1 character.png"
zoom 0.35
and use those images for imagebuttons
Yuvan raj
Regular
Posts: 38 Joined: Wed Feb 17, 2021 11:24 am
Contact:
#6
Post
by Yuvan raj » Sun May 23, 2021 7:58 am
Alex wrote: ↑ Sun May 23, 2021 6:44 am
Try to declare all images, like
Code: Select all
image button_1_idle:
"images/status_images/characters/1 character.png"
zoom 0.35
and use those images for imagebuttons
Declared all the images event the close button but still getting the same results.
Code: Select all
image close_idle:
"images/guichange/close_idle.png"
zoom 0.2
image close_hover:
"images/guichange/close_hover.png"
zoom 0.2
image backfont_idle:
"images/guichange/backfont_idle.png"
zoom 0.18
image backfont_hover:
"images/guichange/backfont_hover.png"
zoom 0.18
image 1_character:
"images/status_images/characters/1 character.png"
zoom 0.3
image 2_character:
"images/status_images/characters/2 character.png"
zoom 0.3
image 3_character:
"images/status_images/characters/3 character.png"
zoom 0.3
image 4_character:
"images/status_images/characters/4 character.png"
zoom 0.3
image 5_character:
"images/status_images/characters/5 character.png"
zoom 0.3
image 6_character:
"images/status_images/characters/6 character.png"
zoom 0.3
image 7_character:
"images/status_images/characters/7 character.png"
zoom 0.3
screen charactersbuttonlist():
vbox:
ypos 130
xmaximum 1468
xminimum 1468
spacing 30
xalign 0.5
vbox:
spacing 30
xalign 0.5
hbox:
spacing 30
imagebutton idle "1_character" action [SetVariable("characters_imagebutton_list_boolean", False), SetVariable("romi_character_imagebutton", True), Hide("charactersbuttonlist")]
imagebutton idle "2_character" action NullAction()
imagebutton idle "3_character" action NullAction()
hbox:
spacing 30
imagebutton idle "4_character" action NullAction()
imagebutton idle "5_character" action NullAction()
imagebutton idle "6_character" action NullAction()
hbox:
spacing 30
imagebutton idle "7_character" action NullAction()
Still getting the same result.
Alex
Lemma-Class Veteran
Posts: 3090 Joined: Fri Dec 11, 2009 5:25 pm
Contact:
#7
Post
by Alex » Sun May 23, 2021 1:02 pm
Could you provide a test project with some images and code for the screen to let people check it?
Users browsing this forum: No registered users