About 284 results
Open links in new tab
  1. Change the position of the origin in PyGame coordinate system

    Nov 17, 2015 · Is it possible to change the coordinate system in PyGame to make it work like this? Unfortunately, pygame does not provide any such functionality. The simplest way to do it …

  2. python - pygame, how do you get coordinates of a graphic

    Mar 4, 2019 · You can use collision response rect2 = pygame.draw.rect(screen, green, [lead_x,lead_y, 50, 50]) rect1 = pygame.draw.rect(screen, blue, [lead_x1,lead_y1, 50 ,50]) if …

  3. How can I get the coordinates of a sprite's position in pygame?

    Nov 15, 2013 · So, you can use rect.left for the x coordinate, and rect.top for the y coordinate. These are attributes, not functions. @Timmy you can do the same with screen - screen_rect = …

  4. pygame.Rectpygame v2.6.0 documentation

    Sets the position and size of the rectangle, in place. See parameters for pygame.Rect() pygame object for storing rectangular coordinates for the parameters of this function.

  5. 3d Projection from scratch in PyGame in 200 lines of Code!

    Feb 15, 2024 · The first function to_screen_coordinates converts any 2d coordinates’ origin to the center of the screen. The next one to_rotation_coordinates is the opposite.

  6. Pygame coordinate positioning : r/learnpython - Reddit

    Oct 17, 2023 · You'll have to calculate the coordinate using math. But python should be doing the math for you. pygame usually provides you with all the variable you need. For example, many …

  7. 3.7: Pixel Coordinates - Engineering LibreTexts

    The Pygame framework often represents Cartesian Coordinates as a tuple of two integers, such as (4, 0) or (2, 2). The first integer is the X coordinate and the second is the Y coordinate. …

  8. Problem with pygame's coordinates : r/pygame - Reddit

    Feb 16, 2023 · So when setting an image's coordinates in pygame, by default it sets the top-left corner of the image to those coordinates. If you want the center of it you should subtract half …

  9. python - Pygame Display Position - Stack Overflow

    Nov 9, 2010 · There is a pygame.display.get_wm_info() call that gets you the Window handler -- from then on, it is using either X11 or Windows API32 to get information from the window …

  10. Help with Coordinates : r/pygame - Reddit

    Apr 6, 2023 · pygame.draw.rect(screen, GrassGreen, pygame.Rect(z, c, Tile, Tile)) So I want to check a part of the list IE "X64Y32" and make a rect at those coordinates if the player (PX/PY) …

  11. Some results have been removed
Refresh