[Solved!]Can image buttons not overlap?

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
KarmaLarma
Newbie
Posts: 23
Joined: Wed May 10, 2017 11:40 pm
Projects: Deadly Vice
Tumblr: karmalarma
Deviantart: karmalarma
itch: karmalarma
Contact:

[Solved!]Can image buttons not overlap?

#1 Post by KarmaLarma » Tue Apr 10, 2018 5:37 pm

I've run into an odd problem with my UI. I wanted my quick menu's image buttons to overlap slightly at the edges, giving the appearance of little cards that are slightly splayed over each other and move up a bit when hovered over. I got the buttons all working but then when I started to arrange them I noticed something weird.

Now, I'm doing this by trial and error, so I just left the game open with the "reload" setting on so that each time I changed coordinates, it would show the move and I could just adjust a little bit at a time until the buttons lined up with the window. But I found after getting to a certain point, it won't let me make the buttons overlap. In fact, to test it I even gave two buttons the same coordinates, and they are still side by side.

imagebutton auto "gui/qsave_%s.png" action QuickSave() xpos 99 ypos 179 focus_mask True
imagebutton auto "gui/menu_%s.png" action ShowMenu('preferences') xpos 99 ypos 179 focus_mask True

Image

^The Quicksave and Menu buttons are given the exact same coordinates but just kind of butt up against each other at the edges. The Menu button almost overlaps the Quirks button, but won't move any close to it even using coordinates that should be further to the right than the Quirks button.

I'm using code from this guide for the buttons, so perhaps there is just something about it that prevents this that I don't get?
Last edited by KarmaLarma on Tue Apr 10, 2018 8:33 pm, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1306
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Can image buttons not overlap?

#2 Post by Remix » Tue Apr 10, 2018 6:43 pm

You would need to put the buttons in a fixed: or frame: rather than hbox:
The hbox is the reason they will not overlap
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
KarmaLarma
Newbie
Posts: 23
Joined: Wed May 10, 2017 11:40 pm
Projects: Deadly Vice
Tumblr: karmalarma
Deviantart: karmalarma
itch: karmalarma
Contact:

Re: Can image buttons not overlap?

#3 Post by KarmaLarma » Tue Apr 10, 2018 8:33 pm

That fixed it! The frame one made a big black box I didn't want there but using it as Fixed instead made it where I could move the buttons wherever I wanted and still use them. Thanks a bunch!

Post Reply

Who is online

Users browsing this forum: Google [Bot]