So I made a character creation system, and everything works really fine (stats, name input, character customization, etc.) BUT I have a display issue.
I can't find what the problem is here. I think it has to do with the way calculs are done in renpy, I tried two differents way to call the screen (calling the screen and showing the screen in a label loop), both of those ways worked fine BUT with the same issue as a result : When one of the value in the character creation get to 0 (minimum) or 10 (maximum) the button that follows in the script shows it focus mask for a fraction of second.
Is there an explanation for this to happen ? Am I missing out on something here ?
Having all the imagebuttons always showing and using nullaction instead of not showing useless imagebutton is not possible for me in terms of design choice.
Here is the portion of the script :
Code: Select all
screen creationperso:
zorder 101
if Beaute > 0:
imagebutton auto "MenuCreation/moins1_%s.png" xpos 0.304 xanchor 0.5 ypos 0.75 yanchor 0.5 action [ SetVariable("Beaute", Beaute - 1), SetVariable("pointsdecrea", pointsdecrea + 1) ]
if Beaute < 10:
if pointsdecrea > 0:
imagebutton auto "MenuCreation/plus1_%s.png" xpos 0.444 xanchor 0.5 ypos 0.75 yanchor 0.5 action [ SetVariable("Beaute", Beaute + 1), SetVariable("pointsdecrea", pointsdecrea - 1) ]
vbox at Position(xpos = 0.376, xanchor=0.5, ypos=0.71, yanchor=0.0):
label "{b}{size=+8}{color=#000}Beauté [Beaute]{/color}{/size=+8}{/b}" at truecenter xminimum 0
bar range Beaute_max value Beaute xmaximum 200 at truecenter
if Intelligence < 10:
if pointsdecrea > 0:
imagebutton auto "MenuCreation/plus2_%s.png" xpos 0.444 xanchor 0.5 ypos 0.85 yanchor 0.5 action [ SetVariable("Intelligence", Intelligence + 1), SetVariable("pointsdecrea", pointsdecrea - 1) ]
if Intelligence > 0:
imagebutton auto "MenuCreation/moins2_%s.png" xpos 0.304 xanchor 0.5 ypos 0.85 yanchor 0.5 action [ SetVariable("Intelligence", Intelligence - 1), SetVariable("pointsdecrea", pointsdecrea + 1) ]
vbox at Position(xpos = 0.376, xanchor=0.5, ypos=0.81, yanchor=0.0):
label "{b}{size=+8}{color=#000}Intelligence [Intelligence]{/color}{/size=+8}{/b}" at truecenter xminimum 0
bar range Intelligence_max value Intelligence xmaximum 200 at truecenter
if Metabolisme < 10:
if pointsdecrea > 0:
imagebutton auto "MenuCreation/plus3_%s.png" xpos 0.444 xanchor 0.5 ypos 0.95 yanchor 0.5 action [ SetVariable("Metabolisme", Metabolisme + 1), SetVariable("pointsdecrea", pointsdecrea - 1) ]
if Metabolisme > 0:
imagebutton auto "MenuCreation/moins3_%s.png" xpos 0.304 xanchor 0.5 ypos 0.95 yanchor 0.5 action [ SetVariable("Metabolisme", Metabolisme - 1), SetVariable("pointsdecrea", pointsdecrea + 1) ]
vbox at Position(xpos = 0.376, xanchor=0.5, ypos=0.91, yanchor=0.0):
label "{b}{size=+8}{color=#000}Métabolisme [Metabolisme]{/color}{/size=+8}{/b}" at truecenter xminimum 0
bar range Metabolisme_max value Metabolisme xmaximum 200 at truecenter
vbox at Position(xpos = 0.376, xanchor=0.5, ypos=0.48, yanchor=0.0):
label "{b}{size=+100}{color=#FFF121}[pointsdecrea]{/color}{/size=+100}{/b}" at truecenter xminimum 0
input xpos 0.5365 xanchor 0.0 ypos 0.84 yanchor 0.0 allow '{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzçÇÊÉêéèîïôöûüêëâä}' default nomdujoueur changed name_func pixel_width 150
vbox at Position(xpos = 0.47, xanchor=0.0, ypos=0.8, yanchor=0.0):
label "{b}{size=18}{color=#000}Le diplôme du baccalauréat général{/color}{/size}{/b}" at left xminimum 0
vbox at Position(xpos = 0.47, xanchor=0.0, ypos=0.82, yanchor=0.0):
if menu_art:
label "{b}{size=18}{color=#000}en Série Littéraire{/color}{/size}{/b}" at left xminimum 0
elif menu_Economie:
label "{b}{size=18}{color=#000}en Série Économique et Sociale{/color}{/size}{/b}" at left xminimum 0
elif menu_Science:
label "{b}{size=18}{color=#000}en Série Scientifique{/color}{/size}{/b}" at left xminimum 0
vbox at Position(xpos = 0.47, xanchor=0.0, ypos=0.86, yanchor=0.0):
label "{size=18}{color=#000}né(e) le [jourdenaissance]/[moisdenaissance]/1998{/color}{/size}" at left xminimum 0
vbox at Position(xpos = 0.47, xanchor=0.0, ypos=0.84, yanchor=0.0):
label "{size=18}{color=#000}est conféré à{/color}{/size}" at left xminimum 0
vbox at Position(xpos = 0.47, xanchor=0.0, ypos=0.90, yanchor=0.0):
label "{size=18}{color=#000}Signature du directeur:{/color}{/size}" at left xminimum 0
vbox at Position(xpos = 0.62, xanchor=0.0, ypos=0.90, yanchor=0.0):
label "{size=18}{color=#000}Signature du titulaire:{/color}{/size}" at left xminimum 0
if pointsdecrea > 0:
imagebutton auto "diploma_hand_%s.png" focus_mask True action [ SetVariable("terminay", 1),Play ("sound", "SE/impossible.ogg")] unhovered SetVariable("terminay", 0)
elif nomdujoueur == "":
imagebutton auto "diploma_hand_%s.png" focus_mask True action [ SetVariable("terminay", 2),Play ("sound", "SE/impossible.ogg")] unhovered SetVariable("terminay", 0)
else:
imagebutton auto "diploma_hand_%s.png" focus_mask True action [ Play ("sound", "SE/papier.mp3"), Hide("creationperso"), Jump("diplomafait")] unhovered SetVariable("terminay", 0)
Thank you very much if you read this far !