Have also tried using global active but this changes all of the objects and not only the instance. I have tried to use with the same results. The self.active is not being save or overwritten on the object. I made a Checkbox class in pygame and it is working fine when run on the same file as the pygame loop, but doesn't work as intended when I import the class and create an instance. Self.screen = _mode((self.SCREEN_WIDTH, self.SCREEN_HEIGHT))Ĭheckbox_1 = Square_checkbox(0, 0, self.screen, 30, 30, defaults.RED, defaults.WHITE, 'checkbox_1')Ĭheckbox_2 = Square_checkbox(40, 0, self.screen, 30, 30, defaults.RED, defaults.WHITE, 'checkbox_2')Ĭheckbox_3 = Square_checkbox(-100, -140, self.screen, 30, 30, defaults.RED, defaults.WHITE, 'checkbox_3')Ĭheckbox_4 = Square_checkbox(-100, -110, self.screen, 30, 30, defaults.RED, defaults.WHITE, 'checkbox_4')Ĭheckbox_5 = Square_checkbox(-100, -80, self.screen, 30, 30, defaults.RED, defaults.WHITE, 'checkbox_5')Įdit1: As mentioned by Rabbid76 taking out the part that works and this adding the game loop. From stuff_that_works import Square_checkbox
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |