[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Native PyGame method for automatically scaling inputs to a surface resolution?



Hello,

	back July, I posted a question on StackOverflow titled that so
far still did not get any answer. So - although I believe the answer is
quite simply "NO" - I thought to repost it here:

----------------

In my program (which uses pygame to draw objects on the video) I have
two representation of my world:

- A physical one that I use to make all the calculations involved in the
  simulation and in which objects are located on a 1000x1000 metres
  surface.
- A visual one which I use to draw on the screen, in which my objects
  are located in a window measuring 100x100 pixels.

What I want to achieve is to be able to pass to my pygame drawing
functions (which normally accept inputs in pixels) my
physical/real-word coordinates. In other words, I would like to be able
to say:

Draw a 20m radius circle at coordinates (200m, 500m)
using the precise pygame syntax:

pygame.draw.circle(surface, (255,255,255), (200,500), 20)
and get my circle of 2px radius at centred on pixels (20,50).

----------------

If you are on SO and would like to answer there [too], I'll be happy to
dispense upvotes! ;) http://stackoverflow.com/q/6807459/146792