I'm using:
check = pygame.image.load("check.png")
checkrect = check.get_rect()
checkrect = checkrect.move(0, 200)
I want to move it to 50, 50 here can some one help?
I'm using:
check = pygame.image.load("check.png")
checkrect = check.get_rect()
checkrect = checkrect.move(0, 200)
I want to move it to 50, 50 here can some one help?
pygame.Surface.get_rect.get_rect() returns a rectangle with the size of the Surface object, that always starts at (0, 0) since a Surface object has no position. The position of the rectangle can be specified by a keyword argument. For example, the top left corner of the rectangle can be specified with the keyword argument topleft. The center of the rectangle can be specified with the keyword argument center. These keyword argument are applied to the attributes of the pygame.Rect before it is returned (see pygame.Rect for a full list of the keyword arguments).
check = pygame.image.load("check.png")
checkrect = check.get_rect(topleft = (50, 50))
Alternatively, you can set the position of the rectangle after the rectangle has been created:
check = pygame.image.load("check.png")
checkrect = check.get_rect()
checkrect.topleft = (50, 50)