Search Unity

Custom cursor acts different in full screen and windowed modes

Discussion in 'Linux' started by mageaster, Feb 6, 2017.

  1. mageaster

    mageaster

    Joined:
    Sep 1, 2015
    Posts:
    85
    Hi. I'm trying to create custom cursor pointer that changes while hovering over an object.

    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class CustomCursorPointer : MonoBehaviour {
    7.    public Texture2D cursorTexture2D;
    8.  
    9.    private CursorMode cursorMode = CursorMode.Auto;
    10.    private Vector2 hotSpot = Vector2.zero;
    11.  
    12.    public void OnMouseEnter() {
    13.      SetCustomCursor (cursorTexture2D);
    14.    }
    15.  
    16.    public void OnMouseExit() {
    17.      SetCustomCursor (null);
    18.    }
    19.  
    20.    private void SetCustomCursor(Texture2D curText) {
    21.      Cursor.SetCursor (curText, hotSpot, cursorMode);
    22.    }
    23.      
    24.  
    25. }
    26.  

    apply it to a cube, build the project. When I start the application in fullscreen mode, the pointer uses system cursor only, if I start it in windowed mode, cursor is only custom. In game mode within the editor custom shape appears near the arrow. Is it a bug, known issue or something that I've missed out?
     
  2. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    It looks like you've found a bug with our cursor handling from the switch to SDL - it should be fixed in an upcoming build.