Page 1 of 1

Custom cursor is not visible in fullscreen

Posted: Thu Oct 06, 2016 1:54 pm
by baemz
Hey!

I'm currently working on a project where we use a custom cursor. The problem is that when we use this custom cursor and uses it in fullscreen it is not visible. Since I have two screens I can "de-focus" the project and then the cursor appears when hovering the window. But as soon as I press it it goes away.
I've also figured out that it is present, but it's just not visible, because I can still use it as normal in my application. I just can't see it.

The acctual cursors is being loaded correctly and it all works perfectly for all my project members, except two of us.
We have been searching for everything that could be the reason, but found nothing. We've tried to use the "setVisible" and "setGrabbed" functions but it gives nothing.

Down below I'll post some code snippets from where we use it.

Code: Select all

function RoomManagerUpdate(dt)
  if love.mouse.isDown(1)
  then love.mouse.setCursor(cursorMousePressed)
  else love.mouse.setCursor(cursorDefault)
  end
end

function LoadItems()  
  cursorDefault = love.mouse.newCursor("Graphics/Interfaces/cursor_hand_open.png", 20, 40)
  cursorMousePressed = love.mouse.newCursor("Graphics/Interfaces/cursor_hand_grab.png", 20, 40)
  cursorHover = love.mouse.newCursor("Graphics/Interfaces/cursor_hand_Point.png", 20, 40)
end

Re: Custom cursor is not visible in fullscreen

Posted: Thu Oct 06, 2016 4:22 pm
by slime
What OS are you (and the other project member whose cursor is broken) using?

Re: Custom cursor is not visible in fullscreen

Posted: Thu Oct 06, 2016 5:40 pm
by baemz
slime wrote:What OS are you (and the other project member whose cursor is broken) using?
Everyone is using the same version of Windows 10.

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 2:36 am
by Dr. Peeps
I'm getting this same behaviour, but only for large cursor images. They work fine in windowed mode regardless of size, but if it's large, as soon as I call love.window.setFullscreen(true), the cursor is no longer visible. A 256x256 cursor works fine, but a 512x512 cursor will disappear on setFullScreen(true). Could anyone verify this behaviour for me? (Just call love.mouse.newCursor() on a large .png and then go fullscreen.) Thanks!

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 5:38 am
by Dr. Peeps
BTW I'm also using Windows 10.

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 6:56 pm
by KayleMaster
Isn't a 512x512 cursor a bit excessive?

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 7:20 pm
by Dr. Peeps
KayleMaster wrote: Fri Jan 19, 2018 6:56 pm Isn't a 512x512 cursor a bit excessive?
You mean 512x512 is too large an image to want to move with the mouse? Not for my purposes. As far as I know, there is no size limit enforced on cursors. Anyway, the issue is: Why does it work in a window and not in fullscreen mode?

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 7:28 pm
by Dr. Peeps
Further testing shows that any cursor image wider than 256 pixels will not appear in fullscreen mode. 256 works, 257 is invisible. Weird ....

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 8:01 pm
by KayleMaster
Oh, that's a clever way to snap to mouse. Like dragging something.
Anyways, it supports only power of two textures. I guess.
257 is not in the range of 2^8, so it fits it in the next size - 512 (2^9).

Re: Custom cursor is not visible in fullscreen

Posted: Fri Jan 19, 2018 8:42 pm
by Dr. Peeps
KayleMaster wrote: Fri Jan 19, 2018 8:01 pm Oh, that's a clever way to snap to mouse. Like dragging something.
Yes, and it's rock solid smooth. I could simply draw a regular image at the current mouse position ("do-it-yourself mouse cursor") to fix the problem, but there is very noticeable lag when doing that. The cursor is updated much faster than I can manage in LÖVE code.
KayleMaster wrote: Fri Jan 19, 2018 8:01 pm Anyways, it supports only power of two textures. I guess.
257 is not in the range of 2^8, so it fits it in the next size - 512 (2^9).
That's not the case, as 512 doesn't work. And 255 does work. And of course 257 does work in windowed mode - it's only when in fullscreen mode that larger cursors stop drawing.