Absolute rotation in PyGame? [duplicate] - python

This question already has answers here:
How do I rotate an image around its center using Pygame?
(6 answers)
How can you rotate an image around an off center pivot in Pygame
(1 answer)
Closed 2 years ago.
I'd just like to change the degree an object is rotated at, pygame.transform.rotate increments it.
Can you directly edit the object's attributes? Printing the object just displays <Surface(50x50x24 SW)>

Related

Pygame Chroma Key [duplicate]

This question already has answers here:
How can I make an Image with a transparent Backround in Pygame?
(2 answers)
Pygame image transparency confusion
(1 answer)
How to convert the background color of image to match the color of Pygame window?
(1 answer)
Closed 2 months ago.
There's a lot of files in directory that has background that I need to chroma key, and as said theres a lot of the files so it would be hard to do it using hand
is there any way I can add Chroma Key To Pygame?

Is there a way to make white text with black border in pygame? [duplicate]

This question already has answers here:
Have an outline of text in Pygame
(2 answers)
How to save an image with the outline text using pygame?
(1 answer)
Closed 9 months ago.
I am trying to make text that is white in the inside (main color) and a thin black border on the outside so the text stands out. Please leave suggestions if you have any!

Set opacity of image in pygame [duplicate]

This question already has answers here:
How do I blit a PNG with some transparency onto a surface in Pygame?
(4 answers)
How can I make an Image with a transparent Backround in Pygame?
(2 answers)
Closed 2 years ago.
Okay guys, I'm trying to fade out an image. So given this:
img_ = pygame.image.load('circle.png')
screen.blit(img_, [100, 100])
how can I change the opacity of img_? Thanks!
Pygame surfaces have a method named set_alpha() for this, which takes a value between 0 and 255.
Relevant docs: https://www.pygame.org/docs/ref/surface.html#pygame.Surface.set_alpha

In pygame, how do I rotate an image around its middle bottom? [duplicate]

This question already has answers here:
How can you rotate an image around an off center pivot in Pygame
(1 answer)
How do I rotate an image around its center using Pygame?
(6 answers)
Closed 2 years ago.
I am making 2D Tank game and I have a problem with rotating my turret. Turret should rotate around its middle bottom but it rotates around the center.
def turret_rotate(self):
turret_rot_image = pygame.transform.rotate(self.turret_image,self.turret_angle)
turret_rot_rect = turret_rot_image.get_rect(center = self.turret_rect.midbottom)
return turret_rot_image,turret_rot_rect
can anyone help me?
solved

Pygame tilemap collison using hitboxes? [duplicate]

This question already has answers here:
How do I detect collision in pygame?
(5 answers)
How to detect collisions between two rectangular objects or images in pygame
(1 answer)
Closed 2 years ago.
I want to make that every tile has a hitbox...
And how to check if player collides with them...
Heres the code:
http://pastebin.com/56LbcMPA
EDIT: And i need help with this!

Categories