Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Creating Xbox game, unwanted cursor during runtime

Discussion in 'Windows' started by kinguhdahood5, Apr 4, 2019.

  1. kinguhdahood5

    kinguhdahood5

    Joined:
    Dec 18, 2018
    Posts:
    84
    Hi, I'm relatively new to unity all together, just reaching around 4 to 5 months with it, but I have a demo ready and I'm trying to disable the mouse that is in the uwp game all-together. I've looked it up, and it tells me that I need to use this piece of code for the constructor to my app:

    public App() {
    this.InitializeComponent();
    this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
    this.Suspending += OnSuspending;
    }

    But I don't know where the author was meaning for me to put it. Am I supposed to put this into the app.xaml after the game is built on the visual studios file or do I input it into the game before the build?

    where's the constructor I'm looking for?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,699
    Are you able to build D3D build type instead of XAML? That will hide the cursor automatically.
     
    kinguhdahood5 likes this.
  3. kinguhdahood5

    kinguhdahood5

    Joined:
    Dec 18, 2018
    Posts:
    84
    Thanks for the reply, for some reason I didn't think the D3D was what I was looking for but it was, thanks again!