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.
How can I have 2 images inside same vbox without them interacting with each other. I know I could make another vbox but that would be time consuming to adjust x and y of another image to match the x,y of my main image.
For example here I have code that shows party members on screen. Every member have its own image that is 120x120 . When member gets debuffed small icon should apper over the existing image that is 35x35 WITHOUT messing up the x,y location of my [team_front_line] members. What I need to do in order to disable x,y interaction between those 2 images?
screen battle_stats():
vbox:
xalign 0.250
yalign 0.400
spacing 80
for player in team_front_line: # Always show players pictures on screen
if player.hp > 1:
add player.picture
for skill in skill_active: # If player is debuffed show small debuff icon on him
if skill.cooldown >= 1:
for player in team_front_line:
if player.debuffed:
add skill1.picture
Last edited by Nero on Tue Dec 11, 2018 2:33 pm, edited 1 time in total.
Perhaps the best thing to do is to nest a Fixed inside your vbox for each character, and then put your character image and 35x35 inside that. This way, the presence or absence of the 35x35 won’t affect the vbox layout, since all it will see is the fixeds.
Ok tried this method it works also. There is other method I thought of not so proud of it but it work. I gave to if player.debuffed else: and added blank image and set its xpos off screen xpos -2000 like so. But using fixed is much more better way of doing it. Thanks.