Custom cursor is not visible in fullscreen

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.
Post Reply
baemz
Prole
Posts: 2
Joined: Thu Oct 06, 2016 1:46 pm

Custom cursor is not visible in fullscreen

Post 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
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Custom cursor is not visible in fullscreen

Post by slime »

What OS are you (and the other project member whose cursor is broken) using?
baemz
Prole
Posts: 2
Joined: Thu Oct 06, 2016 1:46 pm

Re: Custom cursor is not visible in fullscreen

Post 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.
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: Custom cursor is not visible in fullscreen

Post 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!
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: Custom cursor is not visible in fullscreen

Post by Dr. Peeps »

BTW I'm also using Windows 10.
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Custom cursor is not visible in fullscreen

Post by KayleMaster »

Isn't a 512x512 cursor a bit excessive?
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: Custom cursor is not visible in fullscreen

Post 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?
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: Custom cursor is not visible in fullscreen

Post 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 ....
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Custom cursor is not visible in fullscreen

Post 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).
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: Custom cursor is not visible in fullscreen

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests