Python Forum
I think this is a problem with returning? maby?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I think this is a problem with returning? maby?
#5
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()
Reply


Messages In This Thread
RE: I think this is a problem with returning? maby? - by TheNumericDolfin - Aug-16-2018, 06:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem returning values Naito 7 3,886 Jan-19-2019, 08:21 PM
Last Post: Naito

Forum Jump:

User Panel Messages

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