Adam's Lair Forum

game development and casual madness
It is currently 2018/09/25, 15:56

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2018/09/11, 16:17 
Novice Member
Novice Member

Joined: 2017/08/13, 16:10
Posts: 12
Role: Hobbyist
Short question, how do I hide the mouse cursor in-game?

I tried
Code:
 DualityApp.UserData.SystemCursorVisible = false;
but that didn't have any effect.

I want the system mouse cursor on by default, but in certain situations in-game I wish to hide it. Is that possible?


Top
 Profile  
 
PostPosted: 2018/09/11, 18:18 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 879
Location: Italy
Role: Hobbyist
Going by memory here, but if I don't remember wrong you need to reassign the whole UserData object

Code:
var userData = DualityApp.UserData;
userData.SystemCursorVisible = false;
DualityApp.UserData = userData;

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2018/09/11, 19:05 
Novice Member
Novice Member

Joined: 2017/08/13, 16:10
Posts: 12
Role: Hobbyist
Hmm.. that did hide the mouse cursor, but it totally messed up the resolution. The whole screen went black for a second and then Windows popped up a warning with "This is not your primary resolution etc. etc..."

I tried this
Code:
var userData = DualityApp.UserData;
            userData.GfxHeight = (int)DualityApp.TargetResolution.Y;
            userData.GfxWidth = (int)DualityApp.TargetResolution.X;
            userData.SystemCursorVisible = false;
            DualityApp.UserData = userData;


But no difference.

Any more ideas? :)


Top
 Profile  
 
PostPosted: 2018/09/11, 21:25 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 879
Location: Italy
Role: Hobbyist
Weird.. for me it works (tested both on duality v2 and v3) :wtf:

Gfycat Video - Click to Play. [Source]


Code:
void ICmpUpdatable.OnUpdate()
{
   if (DualityApp.Keyboard.KeyHit(Duality.Input.Key.Space))
   {
      var userData = DualityApp.UserData;

      userData.SystemCursorVisible = !userData.SystemCursorVisible;
      DualityApp.UserData = userData;
   }
}

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group