
Help: How can I hide mouse cursor ingame?
Moderator: Moderators
Help: How can I hide mouse cursor ingame?
How can I hide mouse cursor ingame? 

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
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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).
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.
Re: Help: How can I hide mouse cursor ingame?

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
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Help: How can I hide mouse cursor ingame?
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...
EDIT:
/cross it is...

Re: Help: How can I hide mouse cursor ingame?
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...
Re: Help: How can I hide mouse cursor ingame?
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
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

-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Re: Help: How can I hide mouse cursor ingame?
Hide without using lua or any special tricks:
Press middle mouse button to go into cross mode -> "/cross 0"
Press middle mouse button to go into cross mode -> "/cross 0"
Re: Help: How can I hide mouse cursor ingame?
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.
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Re: Help: How can I hide mouse cursor ingame?
Or you could press F5, wich hides everything (including Lua)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.