[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Native PyGame method for automatically scaling inputs to a surface resolution?
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Native PyGame method for automatically scaling inputs to a surface resolution?
- From: Mac Ryan <quasipedia@xxxxxxxxx>
- Date: Fri, 23 Sep 2011 10:29:11 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 23 Sep 2011 04:29:22 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=5zEz1StLBZIlYNYogx2+/nOxhrL7yPTbpvmziXMJqD8=; b=KoiH553CWPvb7/2go0x8ZWfygHTn4OpnoR0qVJR7f4zoIKpK6a1jCf0budf9gOL2Oa 7Yxkj7dF3qTqxUdVBRN5ahZQpVJZGBG+InfYNXRvkYKf2StOPe2DV4PPE4a/Z8loMWR5 lMLbbEwlQgJBYnSkH1AQKQdEcNSBUkko3/QlA=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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