I came across this problem in pygame. Let say I've 3 different page(frame), 1 is called menu, 1 called highscore the other is called game. In my menu frame, I've a button called start, which will brings me to game frame. This is the coordinate:
button("Start",340,510,115,40,lightYellow, blue, action = "Start")
In my highscore frame, I've a button called back, which will brings me back to the menu frame. This is the coordinate:
button("Back",340,510,115,40,white,blue, action = "Menu")
When I'm running this code, I realise that the coordinate will override each other. Which mean that when I'm in highscore frame, and click on the "back" button, by right, it should bring me to the menu frame instead. However, this isn't the case; it brought me to game frame.
Just wondering, is it that in pygame, buttons cannot shared the same coordinate although they are in different frame? Is there a way to resolve this issue instead of changing to different coordinate.
I understand that in Pygame, there isn't "button", the button I meant was the rectangle that I render.