Strange limit to mouse.getX-getY

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
gerard
Prole
Posts: 5
Joined: Mon Jan 31, 2011 1:08 pm

Strange limit to mouse.getX-getY

Post by gerard »

In a game I am developing I was using a 800x600 resolution. Today I started testing different resolutions, but I noticed a strange thing. The love.mouse.getX function returns 799 if the position of the mouse is greater than 799. The same with love.mouse.getY with a limit of 599. It's so obvious that it has something to do with the original 800x600 resolution that the first thing I've done is to check for some line of code with the numbers 800 or 600, but there are none. Is this a bug or I am doing something wrong?
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Strange limit to mouse.getX-getY

Post by TechnoCat »

Please post code, I've never heard of this happening before.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Strange limit to mouse.getX-getY

Post by tentus »

Mouse coords go from 0 to the screen width or height minus 1. Any higher and the mouse will be off the window, and you should probably pause the game at that point.

@Technocat: to see an example, use the level editor in Kurosuke, I render a glowing mouse symbol just off of the mouse coords, which makes this behavior easy to see.
Kurosuke needs beta testers
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Strange limit to mouse.getX-getY

Post by TechnoCat »

tentus wrote:@Technocat: to see an example, use the level editor in Kurosuke, I render a glowing mouse symbol just off of the mouse coords, which makes this behavior easy to see.
It shows the cursor at the mouse, but I'm not sure this represents the problem he is stating.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Strange limit to mouse.getX-getY

Post by bartbes »

799 is the maximum width because there are 800 pixels, starting from 0, so 799 is the 800th pixel.
Now about why it doesn't go any further, because it then is outside of the window.
gerard
Prole
Posts: 5
Joined: Mon Jan 31, 2011 1:08 pm

Re: Strange limit to mouse.getX-getY

Post by gerard »

I upload the code. I erased all of the code irrelevant to the problem and i just left out a line that goes from the origin (0,0) to the position of the mouse. I upload an image of what happens, as you can see, if the cursor X position is greater than 799, the line gets stuck at 799. I want the line to end at the cursor not only in the 800x600 domain, but in the whole window.

Hope this help understand better my problem.

Thanks
Attachments
main.love
(279 Bytes) Downloaded 151 times
Captura.jpg
Captura.jpg (39.19 KiB) Viewed 4006 times
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Strange limit to mouse.getX-getY

Post by TechnoCat »

It appears I am able to travel to every pixel with your code.
Capture.PNG
Capture.PNG (37.75 KiB) Viewed 4000 times
gerard
Prole
Posts: 5
Joined: Mon Jan 31, 2011 1:08 pm

Re: Strange limit to mouse.getX-getY

Post by gerard »

That is weird. So, what can I do?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Strange limit to mouse.getX-getY

Post by bartbes »

How did you resize the window?
gerard
Prole
Posts: 5
Joined: Mon Jan 31, 2011 1:08 pm

Re: Strange limit to mouse.getX-getY

Post by gerard »

before i had this line :

love.graphics.setMode(800, 600, false, true, 0)

now i have:

love.graphics.setMode(1280, 720, false, true, 0)



As it seems to be a problem with my installation of love, I will try to reinstall it to see if that eliminates the problem.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests