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.
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#1
Post
by Ryue » Thu Jul 30, 2015 7:47 am
I'm tring to use a bar in a defined screen:
Code: Select all
screen myscreen((initiativeList):
hbox:
spacing 5
for initiativePosition in initiativeList:
frame:
vbox:
fixed:
add "myimage"
bar value initiativePosition.CombatStats['Health']['Current'] range initiativePosition.CombatStats['Health']['Total'] xmaximum 64 thumb None left_bar GreenImage right_bar RedImage
The images are defined here:
Code: Select all
init -11:
image RedImage = "#FF0000"
image GreenImage = "#00FF00"
Now I got a few quetisons here:
1.) how can I make the bar as multiline?
2.) I'm getting an error saying name GreenImage is not edfined when I try to run the above code
-
SinnyROM
- Regular
- Posts: 166
- Joined: Mon Jul 08, 2013 12:25 am
- Projects: Blue Birth
- Organization: Cosmic Static Games
-
Contact:
#2
Post
by SinnyROM » Thu Jul 30, 2015 1:35 pm
Try making GreenImage a variable instead of an image; usually the property looks for a string or path.
Code: Select all
init -11:
$ GreenImage = "#00ff00"
I don't understand what you mean by multiline though. Could you clarify please?
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#3
Post
by Ryue » Thu Jul 30, 2015 2:06 pm
As example for multiline (non working though):
Code: Select all
bar
value initiativePosition.CombatStats['Health']['Current']
range .....
For the variable instead of image tnx that works. Althnough I'm a bit confused there. Why? In the manual it says displayable but a string is not a displayable an image would be. Do you have any idea why?
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#4
Post
by Ryue » Thu Jul 30, 2015 3:07 pm
One thing though now.
With the Variable working I tried it out:

As both the range and the current are the same value why is red shown at all? Or can it be hidden somehow?
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#6
Post
by Ryue » Thu Jul 30, 2015 4:46 pm
Yepp that worked tnx.
Then the only thing left is the multiline usage?
-
Alex
- Lemma-Class Veteran
- Posts: 2981
- Joined: Fri Dec 11, 2009 5:25 pm
-
Contact:
#7
Post
by Alex » Thu Jul 30, 2015 5:45 pm
What do you mean by multiline?
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#8
Post
by Ryue » Fri Jul 31, 2015 2:19 am
Something in this way (does not work though as it is wrong grammatic for the compiler).
Code: Select all
bar
value initiativePosition.CombatStats['Health']['Current']
range initiativePosition.CombatStats['Health']['Total']
xmaximum 64
thumb None
left_bar "GreenImage"
right_bar 2RedImage"
So to say not writing it all in one overlong line.
-
mobychan
- Veteran
- Posts: 275
- Joined: Fri Apr 24, 2015 6:31 am
- Projects: The Chosen - Sakura Pink & Gentian Blue
- Organization: Foresoft
- Location: Germany
-
Contact:
#9
Post
by mobychan » Fri Jul 31, 2015 3:22 am
Just put a : behind bar:
Code: Select all
bar:
value initiativePosition.CombatStats['Health']['Current']
range initiativePosition.CombatStats['Health']['Total']
xmaximum 64
thumb None
left_bar "GreenImage"
right_bar 2RedImage"
i think it works with every screen component?
But some need an additional value before the :, for example:
Code: Select all
hotspot (x, y, width, height):
text "my text":
-
Ryue
- Miko-Class Veteran
- Posts: 745
- Joined: Fri Nov 02, 2012 8:41 am
- Projects: Red eyes in the darkness
-
Contact:
#10
Post
by Ryue » Fri Jul 31, 2015 3:50 am
That was it thanks. I still don't believe it that I forgot the ":" .drop. tnx again!
Users browsing this forum: Ocelot