How do I display a bar's value? [Solved]
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.
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.
-
- Newbie
- Posts: 13
- Joined: Sun May 15, 2016 5:30 pm
- Contact:
How do I display a bar's value? [Solved]
I'm having a hard time figuring this out.
First of all here is a picture of what I am trying to do:
https://imgur.com/a/YWHMs
I've made a bar using the following code:
init:
$One = 0
hbox:
bar value VariableValue("One", 100):
xalign 0.0 yalign 0.0
xmaximum 400
ymaximum 15
left_bar Frame("gui/bar/left.png", 10, 0)
right_bar Frame("gui/bar/right.png", 10, 0)
thumb None
thumb_shadow None
The bar can slide with user input which is what I want, but I want to be able to display the number value of where the user slides the bar to.
First of all here is a picture of what I am trying to do:
https://imgur.com/a/YWHMs
I've made a bar using the following code:
init:
$One = 0
hbox:
bar value VariableValue("One", 100):
xalign 0.0 yalign 0.0
xmaximum 400
ymaximum 15
left_bar Frame("gui/bar/left.png", 10, 0)
right_bar Frame("gui/bar/right.png", 10, 0)
thumb None
thumb_shadow None
The bar can slide with user input which is what I want, but I want to be able to display the number value of where the user slides the bar to.
Last edited by sandman12456 on Fri Sep 22, 2017 11:19 pm, edited 1 time in total.
-
- Newbie
- Posts: 13
- Joined: Sun May 15, 2016 5:30 pm
- Contact:
Re: How do I display a bar's value?
Hey thanks a lot that worked great! Do you happen to know how I can save the value? or should I start a new thread for that?
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: How do I display a bar's value?
In your case, the value is already saved in variable name "One".
Not really sure what these bars are for, but you could also use persistent variables to have them save across sessions.
Code: Select all
init:
default One = 0
-
- Newbie
- Posts: 13
- Joined: Sun May 15, 2016 5:30 pm
- Contact:
Re: How do I display a bar's value?
Thanks so much
-
- Newbie
- Posts: 13
- Joined: Sun May 15, 2016 5:30 pm
- Contact:
Re: How do I display a bar's value? [Solved]
I tried reading the persistent variables page you linked to figure it out but i'm a little confused on how I actually make these persistent?
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: How do I display a bar's value? [Solved]
sandman12456 wrote: ↑Sat Sep 23, 2017 5:28 pm I tried reading the persistent variables page you linked to figure it out but i'm a little confused on how I actually make these persistent?
Code: Select all
default persistent.One = 100
Code: Select all
hbox:
bar:
value FieldValue(persistent, "One", 100)
xalign 0.0 yalign 0.0
xsize 400
ysize 15
left_bar Frame("gui/bar/left.png", 10, 0)
right_bar Frame("gui/bar/right.png", 10, 0)
thumb None
thumb_shadow None
text "[persistent.One]"
-
- Newbie
- Posts: 13
- Joined: Sun May 15, 2016 5:30 pm
- Contact:
Re: How do I display a bar's value? [Solved]
Perfect thank you so much for all of your help!
Who is online
Users browsing this forum: Ahrefs [Bot]