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.
I got this annoying problem where numbers that are placed on my HP bar just wont stay pinned on the bar. For example at the start of game everything looks perfect like this
And after those numbers get to 3 or lower decimals this happens messing up the center positioning.
screen battle_info:
hbox:
spacing 125
xalign 0.500 yalign 0.271
if enemy_members_list != []:
for i, each_enemy_member in enumerate(enemy_members_list):
hbox:
add DUMMY_STATS.PLAYER_TEST_BG
text "{color=#000000}[each_enemy_member.TOTAL_CURRENT_HP] / [each_enemy_member.TOTAL_MAX_HP]{/color}" bold True size 14
hbox:
spacing 165
xalign 0.500 yalign 0.296
if enemy_members_list != []:
for i, each_enemy_member in enumerate(enemy_members_list):
hbox:
add DUMMY_STATS.PLAYER_TEST_BG
text "{color=#000000}[each_enemy_member.MAX_MANA] / [each_enemy_member.CURRENT_MANA]{/color}" bold True size 14
Note that I do not want to use frames because then i cant get numbers to be inside the health bars it looks ugly then.. My idea is maybe there is a way to get invisible frame that acts as a normal frame but is not shown on the screen? Is this even possible to do?
Based on your setup, looks like the width of the hbox is changing based on the length of the string (i.e., the box is only as large as the string inside, and 20000/20000 is longer than 0/20000). Try specifying a xminimum.
That said, wouldn't it make more sense to have each character's box (i.e., the health/mana set), be one logical unit rather than all characters' health / all characters' mana? Whatever works for you though, I guess.
Yup specifying the xminimum fixed the problem thanks. Hmm yes I wanted to do it this way but when I put everything in one hbox all my object push around each other which messes up my whole screen. Maybe im doing it wrong I did something like this but everything on screen was out of position...