Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame importing classes
#1
I am creating a quiz program in pygame, I have currently created my main menu which stores my background, buttons and mouse interaction in one class. However, am now attempting to create the quiz starting with maths.

I have successfully imported the class into another file, however, I cannot change the text in those buttons in the new file as these buttons will now hold my answers.and it does not appear to run any code after I import the class into the new file.

[1]: https://i.stack.imgur.com/3jd4h.png # This is the main class in my Main menu file

[1]: https://i.stack.imgur.com/kb5zP.png /This is what my tutor suggested but it has not worked and the text within the button remains the same.

Any help is appreciated
Reply


Messages In This Thread
Pygame importing classes - by Padalinkiller1 - Nov-15-2017, 01:52 PM
RE: Pygame importing classes - by buran - Nov-15-2017, 02:02 PM
RE: Pygame importing classes - by Padalinkiller1 - Nov-15-2017, 02:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Importing classes? frequency 11 4,824 Dec-31-2018, 07:21 PM
Last Post: ichabod801
  IDLE not importing pygame (ok outside of IDLE) miner_tom 1 3,334 Sep-14-2018, 07:54 PM
Last Post: Larz60+
  Problems with importing classes in different folder Xeraphim 3 3,396 Nov-08-2017, 03:20 PM
Last Post: Larz60+
  Using classes? Can I just use classes to structure code? muteboy 5 5,080 Nov-01-2017, 04:20 PM
Last Post: metulburr
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,763 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020