Help: How can I hide mouse cursor ingame?

Help: How can I hide mouse cursor ingame?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Help: How can I hide mouse cursor ingame?

Post by Pendrokar »

How can I hide mouse cursor ingame? :?
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Post by TradeMark »

Create your own copy of the mod, and make the cursor with full transparent color (lila or etc). Thats how i hidded it for my videos.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

TradeMark wrote:Create your own copy of the mod, and make the cursor with full transparent color (lila or etc). Thats how i hidded it for my videos.
Is that the only way? :(
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Code: Select all

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
--  file:    gui_no_mouse.lua
--  brief:   removes the mouse cursor
--  author:  Dave Rodgers
--
--  Copyright (C) 2007.
--  Licensed under the terms of the GNU GPL, v2 or later.
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:GetInfo()
  return {
    name      = "NoMouse",      
    desc      = "Removes the mouse cursor",                               
    author    = "trepan",
    date      = "Oct 06, 2007",      
    license   = "GNU GPL, v2 or later",
    layer     = 99,    -- late drawing 
    enabled   = false  --  loaded by default?
  }
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:DrawScreen()                                     
  Spring.SetMouseCursor('none')
end  
     
     
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

And here's a version that allows you to use a text action:
http://trepan.bzflag.bz/spring/gui_no_mouse.lua

Use /luaui nomouse to toggle the display state (you could also bind
it to a keyset for easier access). The default state is to have the mouse
cursor visible in this version. That makes it easier to always have the
widget enabled (so that it can receive the 'nomouse' command, but not
have the mouse hiding ability enabled).
Last edited by trepan on 06 Oct 2007, 17:36, edited 1 time in total.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Post by TradeMark »

rotfl "Licensed under the terms of the GNU GPL, v2 or later."

one line of code XD
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

1. The second version has more than one line of code ;-)
2. Helluva lot easier to use than your trick, heh?
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Post by TradeMark »

trepan wrote:2. Helluva lot easier to use than your trick, heh?
Yeah, i said it just because i wanted someone to make easier way :D
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Well a lua widget wasn't what I was looking for BUT WHO CARES! Thanks! :-)
User avatar
Neuralize
Posts: 876
Joined: 17 Aug 2004, 23:15

Post by Neuralize »

Is there a lua widget that removes the mouse3 click crosshair? That is really want I need to be gone to make a decent video.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Help: How can I hide mouse cursor ingame?

Post by Jazcash »

Image

Trepans link to the second version is broked so I can't see if that works for what I need it for. Basically I just need a completely clear GUI with no healthbars, cursor or anything else that isn't the actual game.

I came across this whilst searching to see how I could hide the cursor. This only hides the cursor when the GUI is showing and I need it to hide the "Specrun" crosshair anyways....

What would be totally awesome is a widget which just auto hides everything that isn't the actual game when a certain key is pressed.

And if anybody could link me to trepans second version, that would be +10
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Help: How can I hide mouse cursor ingame?

Post by Master-Athmos »

Actually you don't need any Lua at all as there is a command you type in which hides the crosshair cursor on the middle mouse button. Unfortunately I don't remember it right now...

EDIT:
/cross it is... :-)
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Help: How can I hide mouse cursor ingame?

Post by Jazcash »

Hmm actually, I suppose I'll have to ask Regret if he could implement an option to hide the reticle as it's all drawn within the widget itself I guess...
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Help: How can I hide mouse cursor ingame?

Post by Jazcash »

Hmm ok. So now I can have the cursor gone in every view apart from when Specmode is on and F5 is pressed to hide the GUI. I just have a dodgy cursor in the middle of the screen.

Imo F5 should completely get rid of everything not-part-of-the-game including the cursor.

Regret's done some tweaking to his widget but he's just managed to get rid of the green crosshair :( I would've thought this would have to be an engine change but I'm no coder so I guess there's still hope of a fix-widget :D
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Help: How can I hide mouse cursor ingame?

Post by Auswaschbar »

Hide without using lua or any special tricks:
Press middle mouse button to go into cross mode -> "/cross 0"
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Help: How can I hide mouse cursor ingame?

Post by MelTraX »

Btw, you could write a widget that temporarily overrides the widget handler Draw* methods with empty ones. That would disable everything drawn by LuaUI. Wouldn't hide the cursor or the default interface though.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Help: How can I hide mouse cursor ingame?

Post by Auswaschbar »

MelTraX wrote:Btw, you could write a widget that temporarily overrides the widget handler Draw* methods with empty ones. That would disable everything drawn by LuaUI. Wouldn't hide the cursor or the default interface though.
Or you could press F5, wich hides everything (including Lua)
Post Reply

Return to “Help & Bugs”