1

I'm trying to edit a physics object's alpha value but it doesn't seem to be working. Every other value is working, however. What can I do to get the opacity to change?

# Creating objects class
class create_physics_object:
  
  # Rectangle
  def rect(self, space, posX, posY, width, height, mass, color, bodytype):
    body = pymunk.Body(body_type=bodytype)
    body.position = posX, posY
    shape = pymunk.Poly.create_box(body, (width, height))
    shape.mass = mass
    shape.color = color
    space.add(body, shape)
    return shape
create_physics_object = create_physics_object()


# Create object
rect = create_physics_object.rect(space, 32, 32, 32, 32, 30, (255, 0, 0, 50), pymunk.Body.DYNAMIC)
  • 1
    Welcome to Stack Overflow. Please read [ask] and [mre]. *What do you mean* by "doesn't seem to be working? What happens when you run the code? What should happen instead, and how is that different? Also: what is the intended purpose of the class here? (In your own words, what is a class, and what is it for?) – Karl Knechtel Jun 30 '22 at 22:34

0 Answers0