Positioning a hotbar

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
Tonbelly
Newbie
Posts: 6
Joined: Wed Dec 08, 2021 1:26 pm
Tumblr: Tonbelly
Deviantart: Tonbelly
Contact:

Positioning a hotbar

#1 Post by Tonbelly »

Hi there!

I have a hotbar in my script that works just fine when I save the bar image with the same co-ordinates on a 1920x1080 image file. However, it does not work if I save the file out on its own and then use xpos and ypos to place it on the screen with the same height and co-ordinates. I also noticed that if I use both methods at the same time with two different hotbars, the positioning seems to be off somehow. I made sure the image is 71x740, so I'm really not sure how this is happening.

Code: Select all

screen capacity_bar():

    imagemap at color_fade:
	
	# The bar shows up when I use this method, but it stays empty when the capacity value increases.
	# Instead I am just positioning the bar in the image file with transparency, and that works fine.
        # xpos 1718 ypos 135

        auto "bar %s"

        hotbar (1718, 135, 71, 740) value AnimatedValue(capacity, 100, 1.0, capacity_old)
It's not really a big deal because I have a working solution, but it would be nice to know why the other method isn't working as I may want to make the interface a bit more modular in future. Then again, I'll probably add my own bars and vbars to the GUI eventually when I have the time to work on that, but modular imagemaps might be useful as a go-between still.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], CephalonKet, Majestic-12 [Bot]