EndOfDay Bar with Thumb and number that increases

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
Tow4352
Regular
Posts: 48
Joined: Sat Aug 22, 2020 11:27 am
Contact:

EndOfDay Bar with Thumb and number that increases

#1 Post by Tow4352 »

Hello. I hope someone can help me. At the end of the day a bar appears that increases, showing the progress over the day. The stat is LLL (end of day) and LLLStart is the value at the start of the day. A thumb that goes over the right end of the bar and has a number on it is also something this bar is planned to have. The number increases as the bar fills slowly up. 0, 1, 2, 3, 4, 5 etc. Just going up nicely however much the players have leveled the stat.

I hope someone can help me with this. I am not experienced and don't know how to do this sadly.

EDIT: Okay, the error is no more. That is the code for the bar now. It moves up and down and the LLL stat at the end of the day is shown currently as it moves up from LLLStat to LLL. Only thing missing is that the number of the thumb goes from LLLStart to LLL.

Code: Select all

init python:
    def fancy_thumb(st, at):
        return Fixed(
            Image("gui/bar/thumb_bar.png", xalign=0.0, yalign=0.0), #this is whatever your thumb image is
            Text("[LLL]") #simple Text() for testing, you'll probably want to use ParamaterizedText() so you can style it
        ), None

image my_thumb = DynamicDisplayable(fancy_thumb)

---

    timer 1.0 action SetScreenVariable("LLLStart", LLL)
    vbox:
        ypos 0.4
        xpos 0.235
        vbar:
            xysize (58, 440)
            value AnimatedValue(value=LLL, range=150, delay=1.0, old_value=LLLStart)
            thumb "my_thumb"
            thumb_offset -19
            bottom_bar "gui/bar/LLL_Fill.png"
            top_bar "gui/bar/LLL_Empty.png"
        add "gui/bar/LLL_Frame.png" ypos 0.4 xpos 0.235

Post Reply

Who is online

Users browsing this forum: No registered users