So I finished building Chromaestro in Windows Universal 10, and it runs great on a Windows Phone. When I try to run it in Windows 10 on my desktop though, I have several problems:
- The mouse pointer becomes confined to the game’s window; as a result, I’m unable to adjust the window size, maximize/minimize the window, or even close it (I had to alt-F4 to get out of it).
- Problem #1 wouldn’t be too much of an issue if I could just prevent the window from being resized and force a certain resolution, or if I was able to change it in-game. This doesn’t seem to be possible though in Windows 10. Is there any way to at least restrict it to a certain aspect ratio?
Thanks!
Hey,
the cursor shouldn’t be confined to game window, unless you were messing with Unity - Scripting API: Cursor.lockState
I might have been at one point, but I had been trying to pull all that code out. In any case, I did a search in all the files and couldn’t even find any remaining references to the word “cursor”, let alone anything involving its lock state.
EDIT I should also note that it does NOT restrict the cursor if I compile and run it as a regular Windows program, it’s only if I create a Windows Universal 10 app.
What about empty project, did you try building it Universal? Is the cursor confined then?
I’m not sure. It takes a lot of work to get an app, even a blank one, to a state where I can run it as a Universal 10 app. For example, I created a blank app and immediately tried to do a Build and Run as Windows Store Universal 10, and it gives me errors such as, “Manifest references file ((various logo filenames)) which is not part of the payload”. The only way I can fix it is by just doing a build, opening it in Visual Studio, and manually loading icons and changing the manifest references. Which is kind of silly since the default icons and such are in the assets and just aren’t bothered being referenced by default somehow.
What I can say about the app having the problem is this:
- I originally did the arrow pointer as a quad with an arrow that gets repositioned at the mouse’s position, and I was hiding the cursor.
- While it was like this, I could run the first scene of my game (just a logo without the aforementioned mouse pointer) as a Universal 10, and while it is playing, this is the ONLY time I could go in and resize the window, close it, maximize it and such. As soon as the second scene loads (the first one using the arrow), it became confined to the window.
- I removed all of that pointer code and I just inserted a custom mouse cursor instead. As soon as I did that, now the mouse is confined to the window immediately when the first scene starts. I didn’t even touch the script that runs on that scene. The only time I can adjust anything is very briefly, during the splash screen at startup before the first scene starts, and before the custom mouse cursor begins to be used.
So now I’m pretty stumped. Is the custom cursor doing it somehow?
You’re talking probably about software cursor, in that case, this is expected… You could use hardware cursor probably to overcome this problem - Windows apps - custom cursor on hardware mode support - Unity Engine - Unity Discussions