Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Changing cursor size and texture with new UI?

Discussion in 'UGUI & TextMesh Pro' started by douglasg14b, Jan 27, 2015.

  1. douglasg14b

    douglasg14b

    Joined:
    Oct 2, 2014
    Posts:
    34
    Can the cursor be changed with the new UI?

    I've been really struggling with figuring out how to change the cursor texture, size, or rotation without using OnGUI. Everywhere I look are results showing examples of how to to do all three with the legacy GUI system, but I'm not finding any resources on how to do this with the new UI.

    Is there a way to do all 3 with the new UI, and if not is it still ok to use the old GUI system?

    Edit: Been using Cursor.SetCursor() , but any texture I make ends up being massive on screen and the only solutions I've fond to make the cursor smaller is to not use change cursor and instead use the old GUI system.
     
    Last edited: Jan 27, 2015
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    It will be an issue for a while where most (if not all) examples use the Legacy GUI

    For Unity UI, you have several components of the inputbox, where you can alter the placeholder text (default) the value input text field and also the caret (blinking cursor) separately.

    SO to alter the cursor, simply change what you are using for the Caret image.

    Does that answer your question?
     
  3. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    He was talking about the mouse cursor image, not the text input box.

    Now i have the same question, i need to resize the mouse cursor at runtime by code in Unity 5.
    How can i do it?
     
  4. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    nevermind, i've ended up creating different versions of the cursors with GIMP, one for each resolution range