[visionegg] Re: pygame.mouse.get_pos()
- From: adam naples <adam.naples@xxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Wed, 11 Jul 2007 10:26:41 -0700
bottom right?
I think you might mean bottom left?
either way, it depends on what you want to do.
the line
y = screen.size[1]-y # convert to OpenGL coords
is taking the vertical position of the mouse on the screen and
flipping the coordinates, remember opengl coordinates start in the
bottom left, not the upper left.
Are you trying to change the way objects are placed on the screen?
I have a big pile of code for doing things that sounds like they are
related to this, but I'm not sure what you want to do.
hope I can help
-a
On Jul 10, 2007, at 12:30 PM, Maher, Jeffrey wrote:
Hello all,
As I have been going through the programming, I have run into a
major stumbling block when it comes to pygame.mouse.get_pos().
According to the description , pygame.mouse.get_pos() takes the
coordinate mapping system from the upper left hand corner of the
display. Is there anyway to make this map out the coordinates from
the bottom right hand corner, so that standard x-y coordinates can
be applied (such as in the positioning of text)?
For reference here's how the program reads:
just_current_pos = mouse_position
(x,y) = pygame.mouse.get_pos()
y = screen.size[1]-y # convert to OpenGL coords
mouse_position = (x,y)
if just_current_pos != mouse_position:
last_mouse_position = just_current_pos
My attempts at changing the coordinates mathematically (y= -y +600)
have failed, either by having the display outside of the viewing
screen, or my personal favorite, inverting the mouse all-together.
I've tried manipulating the y= line as well as the mouse_position
line, all to no avail.
Any help or suggestions would be greatly appreciated.
Thanks,
Jeff
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
The information contained in this message may be privileged and
confidential. If you are NOT the intended recipient, please notify
the sender immediately with a copy to hipaa.security@xxxxxxxx and
destroy this message.
Please be aware that email communication can be intercepted in
transmission or misdirected. Your use of email to communicate
protected health information to us indicates that you acknowledge and
accept the possible risks associated with such communication. Please
consider communicating any sensitive information by telephone, fax or
mail. If you do not wish to have your information sent by email,
please contact the sender immediately.
- Follow-Ups:
- [visionegg] Re: pygame.mouse.get_pos()
- From: Maher, Jeffrey
- References:
- [visionegg] pygame.mouse.get_pos()
- From: Maher, Jeffrey
Other related posts:
- » [visionegg] pygame.mouse.get_pos()
- » [visionegg] Re: pygame.mouse.get_pos()
- » [visionegg] Re: pygame.mouse.get_pos()
- » [visionegg] Re: pygame.mouse.get_pos()
- » [visionegg] Re: pygame.mouse.get_pos()
Hello all,As I have been going through the programming, I have run into a major stumbling block when it comes to pygame.mouse.get_pos().
According to the description , pygame.mouse.get_pos() takes the coordinate mapping system from the upper left hand corner of the display. Is there anyway to make this map out the coordinates from the bottom right hand corner, so that standard x-y coordinates can be applied (such as in the positioning of text)?
For reference here's how the program reads:
just_current_pos = mouse_position
(x,y) = pygame.mouse.get_pos()
y = screen.size[1]-y # convert to OpenGL coords
mouse_position = (x,y)
if just_current_pos != mouse_position:
last_mouse_position = just_current_pos
My attempts at changing the coordinates mathematically (y= -y +600)
have failed, either by having the display outside of the viewing
screen, or my personal favorite, inverting the mouse all-together.
I've tried manipulating the y= line as well as the mouse_position
line, all to no avail.
Any help or suggestions would be greatly appreciated. Thanks, Jeff ====================================== The Vision Egg mailing list Archives: http://www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html
- [visionegg] Re: pygame.mouse.get_pos()
- From: Maher, Jeffrey
- [visionegg] pygame.mouse.get_pos()
- From: Maher, Jeffrey