Aug-16-2018, 06:48 PM
(This post was last modified: Aug-16-2018, 07:25 PM by TheNumericDolfin.)
just says it is not callable when i do that, despite the fact that menues has a call function.
import Button import Menues import pygame import sys from pygame.locals import * x = 0 y = 30 import os os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y) pygame.font.init() pygame.init() infoObject = pygame.display.Info() correctedscreenheight= (infoObject.current_h - 30) screen = pygame.display.set_mode((infoObject.current_w, correctedscreenheight)) screenxsize = infoObject.current_w screenysize = infoObject.current_h pygame.display.set_caption('Dnd reimagined') mainscreen = pygame.image.load("dnd.png").convert() WHITE = (25 , 25, 25) fuckoff = Button.button() buttoncolorinner = (200, 200, 200) buttoncolorouter = (50, 50, 50) bxp = (infoObject.current_w / 2) byp = (correctedscreenheight / 2) startbuttonstuff = Menues() def keyhandler(): mpos = pygame.mouse.get_pos() clicky = pygame.mouse.get_pos() pressed = pygame.mouse.get_pressed() bxp = startbuttonstuff[0] byp = startbuttonstuff[1] bxw = startbuttonstuff[2] byw = startbuttonstuff[3] otherxcornerofbutton = bxp + bxw otherycornerofbutton = byp + byw if pressed[0] == 1 and bxp < clicky[0] < otherxcornerofbutton and byp < clicky[1] < otherycornerofbutton: buttoncolorinner = (50, 50, 50) buttoncolorouter = (200, 200, 200) startbuttonstuff.Menues.startmenue() else: buttoncolorinner = (200, 200, 200) buttoncolorouter = (50, 50, 50) startbuttonstuff.Menues.startmenue() for event in pygame.event.get(): if event.type == QUIT: pygame.display.quit() pygame.quit() if event.type == pygame.MOUSEBUTTONDOWN: if event.button == 1: if bxp < mpos[0] < otherxcornerofbutton and byp < mpos[1] < (otherycornerofbutton): fuckoff.click() while True: mainscreen = pygame.transform.scale(mainscreen, (infoObject.current_w, infoObject.current_h)) screen.blit(mainscreen, (0, 0)) keyhandler() pygame.display.update()