Any code examples of using bars for setting values of variables?

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.
Post Reply
Message
Author
User avatar
VideoGameVet
Newbie
Posts: 23
Joined: Fri Jun 07, 2019 1:03 pm
Skype: william_volk
Contact:

Any code examples of using bars for setting values of variables?

#1 Post by VideoGameVet » Thu Jun 27, 2019 1:22 pm

I'd like to use bars for users to set variables.

Think of buying items, you would have a bar for each item. Each item would have a cost. You would only have a specific amount of cash.

The user might spend half of their funds on one item, leaving them less for others. Can I adjust a bar based on these limits?

Also, how should I display the text of the value in the screen with the bars?

Thanks.
"A delayed game is eventually good, but a rushed game is forever bad."
- Shigeru Miyamoto

philat
Eileen-Class Veteran
Posts: 1759
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Any code examples of using bars for setting values of variables?

#2 Post by philat » Thu Jun 27, 2019 9:19 pm

Eh. There are a few in the forum but not particularly good ones, I guess. Should be relatively easy to do with: https://www.renpy.org/doc/html/screen_a ... iableValue

Post Reply

Who is online

Users browsing this forum: Nanahs