Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Romano · Mar 12, 2014 at 04:24 AM · mousetutorialcursor

Custom mouse cursor - looking for a really good tutorial.

Hey there, I've been searching for a while now and so far have only found solutions for using a custom mouse cursor in unity that have major problems with them.

Can anyone point me in the direction of a high quality (free) custom mouse cursor solution?

Most of the tutorials I have found seem to result in a mouse cursor that lags behind the "real" mouse cursor. I'm also struggling to find a tutorial that details the proper way to import an image for use as a mouse cursor and how to stop it from appearing blurry.

Can anyone who has already found a good solution save me trawling through a million google results? I just keep finding ones that suck a little bit.

Thanks very much!

Romano

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image getyour411 · Mar 14, 2014 at 05:59 AM 0
Share

Re: the image is blurry. This is typical when the image/texture (say, png for example) on import is left as a Texture in Unity. Select the image in your Assets and the Inspector panel, set Texture type to Cursor and scaling to point. For best results, the image should probably be power of two (if it's not, you'll see a warning in the bottom preview part)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by fifthknotch · Mar 12, 2014 at 04:37 AM

Check this out. Open up your Unity project. Go to File => Build Settings. Click Player Settings at the bottom left corner of the window that opens. If you look at your inspector pane, you will now see your player build settings. The second image from the top is labeled "Cursor". Drag your custom 2D texture you would like to use as your cursor and voilà! custom cursor for all to see.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Romano · Mar 12, 2014 at 06:10 AM 0
Share

I didn't know about that, thanks fifthknotch.

The solution I'm looking for here is a much more flexible and code-based one if anyone has it. I'd like to be able to switch the cursor image at certain times using code. Specifically I'm looking for a really detailed tutorial if one exists.

Thanks :)

avatar image fifthknotch · Mar 12, 2014 at 06:12 AM 1
Share

Code can be found here:

http://docs.unity3d.com/Documentation/ScriptReference/Cursor.SetCursor.html

This will change the texture given above.

avatar image Romano · Mar 12, 2014 at 09:51 AM 0
Share

Thanks again :D

Still would love to see a good tutorial if anyone knows where one is?

avatar image Romano · Mar 14, 2014 at 05:36 AM 0
Share

Unfortunately the above method only seems to work for me in unity but not in the build. I'd settle for a "decent" tutorial if anybody knows of one? :)

avatar image getyour411 · Mar 14, 2014 at 06:06 AM 1
Share

I don't have a tut but I do something like this...

 public Texture2D currentCursor;
 public Texture2D default;
 public Texture2D outOfRange;
 public Texture2D crafting;

... (drag/drop your images into those in Inspector)

Next I define an Enum for each CursorState

 public enum CursorState {
 default,
 outOfRange,
 crafting
 }

 public CursorState cursorState;

Then I have a method that's basically a switch/case which changes the currentCursor Texture2D to be whatever based on CursorState enum value is. Finally in my OnGUI I draw cursor

Also found this http://www.youtube.com/watch?v=$$anonymous$$36D5D$$anonymous$$m-tU

http://answers.unity3d.com/questions/145024/unity3d-custom-cursors.html

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

mouse Input Instantiate 0 Answers

how to stop mouse going out of the screen ? 9 Answers

MouseCursor.Arrow and MouseCursor.Link 3 Answers

How to stop mouse getting out of the game, my game is in webplayer? 2 Answers

Setting the mouse position to specific coordinates 5 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges