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.
-
henvu50
- Veteran
- Posts: 322
- Joined: Wed Aug 22, 2018 1:22 am
-
Contact:
#1
Post
by henvu50 » Thu Jun 17, 2021 5:04 am
As soon as you put two objects in this frame, the xalign & yalign stop working, why is that?!
Code: Select all
screen test8943():
frame:
xalign 0.5
yalign 0.5
background None
textbutton "why12323":
action NullAction()
imagebutton:
idle "a1_idle.png"
hover "a1_hover.png"
focus_mask True
action Jump("dfadf")```
I hate screens so much. This is such a waste of time. I shoudl be able to make a screen in a GUI interface in like 2 minutes, and then BE DONE with it. Instead, making screens goes from minutes to HOURS. what a waste of time.
-
laure44
- Regular
- Posts: 60
- Joined: Mon Mar 08, 2021 10:55 pm
- Projects: Arkan'sTower, Gemshine Lorelei!
- Location: France
-
Contact:
#2
Post
by laure44 » Thu Jun 17, 2021 3:13 pm
I would suggest using
vbox or
hbox instead.
Code: Select all
screen test8943():
vbox:
xalign 0.5
yalign 0.5
textbutton "why12323":
action NullAction()
imagebutton:
idle "a1_idle.png"
hover "a1_hover.png"
focus_mask True
action Jump("dfadf")
But if you need the elements to overlap, you can also use
fixed
Code: Select all
screen test8943():
fixed:
xalign 0.5 yalign 0.5
xfit True yfit True
imagebutton:
idle "a1_idle.png"
hover "a1_hover.png"
focus_mask True
action Jump("dfadf")
textbutton "why12323":
action NullAction()
-
henvu50
- Veteran
- Posts: 322
- Joined: Wed Aug 22, 2018 1:22 am
-
Contact:
#4
Post
by henvu50 » Thu Jun 17, 2021 4:25 pm
It takes one child. If zero, two, or more children are supplied, then a fixed is created to contain them.
i missed that part, thanks!