I have this rectangle drawn using PyBox2D Roger_Waters = Box_2_World.CreateStaticBody(position=(3, 3) ) Roger_Waters_Fixtures = Roger_Waters.CreateEdgeChain([(-10, -10), (-10, 10), (10, 10), (10, -10), (-10, -10)] ) And I use this function to draw it: def my_draw_edge(edge, body, fixture): vertices = [body.transform * edge.vertex1 * PPM, body.transform * edge.vertex2 * PPM] pygame.draw.line(screen, colors[body.type], vertices, vertices) edgeShape.draw = my_draw_edge And this loop to draw all bodies (edge, polygon and circle shapes) for body in Box_2_World.bodies: for fixture in body.fixtures: fixture.shape.draw(body, fixture) This for loop is nested into main PyGame loop PPM means Pixels per meter and my problem is that when I either want to make the PyGame window fullscreen or change PPM using this for loop for event in pygame.event.get(): if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): # The user closed the window or pressed escape running = False # Zoom In/Out elif event.type == KEYDOWN and event.key == pygame.K_KP_PLUS: PPM += 5 elif event.type == KEYDOWN and event. key == pygame.K_KP_MINUS: PPM -= 5 Something weird happens, Circle and Polygon shapes are OK, but the edge shape drawing is moving even though it shouldn’t, and when any other dynamic body hits the edge (not the drawing… Read full this story
- TMI: When Does Fitness Data Become Too Much of a Good Thing?
- Runners invited to celebrate their bodies whatever their shape
- M&S sparks gender-neutral fury after telling male and female customers to use whichever fitting room they 'feel comfortable' in
- Former teacher who quit her job to become a 'body activist' after losing 8st hits back at critics who tell her she's heading for type 2 diabetes and a 'heart attack at 40'
- Body of man found wrapped in front of Galveston home, police say
- Man 'Accidentally' Killed Mother During Argument, Then Dismembered, Disposed Of Her Body
- Man Killed Pregnant Wife For Refusing Sex, Hid Body In Employer's House
- Priority ONE Fitness
- Fitness fans express frustration as Earl Soham gym faces closure following council crack down
- The diet that promises 7kg weight loss in THREE weeks: Dietitian reveals whether the controversial hCG approach really does work as well as people claim
Box2D EdgeShape drawing does not fit to the body have 379 words, post on gamedev.stackexchange.com at October 15, 2019. This is cached page on Game Breaking News. If you want remove this page, please contact us.