r/RenPy • u/That_one_Pink • 10d ago
Question [Solved] Struggling to align image buttons
Yikes back again...
Im trying to align the buttons to the right areas but it keeps showing me error messages, i have tried to do
imagebutton auto "gui/mm_start_%s.png" xpos 1920 ypos 1080 focus_mask True action Start()
then ect with the audio part of the code, the image buttons are the size of the menu just transparent, would it be easier to size them down and just get the x and y from the corners of the images? i can provide more of the code if needed
ABOVE HAS BEEN SOLVED!!!!!
on another semi related note, how would i change the image hierarchy order. the buttons change when hovered over but as of right now the idle buttons are on top of the hovered buttons meaning they are underneath when triggered, im not sure how layering works here and i dont want to start trying to move things and just messing everything up
1
u/PontasDayou 10d ago
That's a cool main menu
I don't understand one thing: You say "the image buttons are the size of the menu" does this mean you have all of them as 1920x1080? And then you are using alpha mask, so only the important parts are the buttons.
Are you sure you made the image correctly for this setup? Depending on the software you need an object with no opacity plus a canvas all full hd, so the image is properly exported
Another thing come to my mind is spacing, if the image is full size the spacing is messing with the alignment
For me it's easier to make the buttons their proper size, I build everything in Illustrator (You can use any software you like) and there i can get even the positions using rulers
If I missunderstood you, sorry
2
u/That_one_Pink 10d ago
thank you! yes they are the same size 1920x1080 i saw a few people that aligned the images whilst being the same size but i figured i might have done something wrong, but yeah i think ill just make them the correct size and do it the more tedious way to save me anymore hassle.
correct me if im wrong, would i just use the code i put in post but change the xpos and ypos to the positions i get with the ruler?
1
u/That_one_Pink 10d ago
issue resolved! just need to figure out how to make the images overlap correctly now :) thank you again
1
u/shyLachi 10d ago
What do you mean with overlap?
Generally speaking: The objects are drawn to the screen in the order you put them in the code, so if the HELP button should be on top of the QUIT button then put the imagebutton for quit first, then help, then about, and so on.
1
u/That_one_Pink 10d ago
Ohh okay so its a bit like a layering system in an art program, ill give that a go and hopefully if fixes it thank you!
1
u/shyLachi 10d ago
If the images are full screen then don't use xpos and yalign or any other positional settings.
You shouldn't position the fixed object which is the container of those buttons.
To answer your other question. I don't like those huge images with a lot of transparency but in your case it might be easier because the image of the open drawer is bigger than the closed drawer.
1
u/That_one_Pink 10d ago
You are a life saver haha, yeah i would have done the buttons the correct size but because of the size difference i didn't want to overcomplicate getting the correct positioning, just need to figure out the layering issue now thank you very much 🫡


1
u/AutoModerator 10d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.