Creating a dot in the centre of the screen, toggleable on button hold
Creating a dot in the centre of the screen, toggleable on button hold
I am looking to create a script that will display an overlay of a small red dot in the centre of the screen. This could either be done by using a .png of a dot, or drawing one. When RButton is pressed and held down, the dot will dissappear. When RButton is not pressed down anymore, the dot will reappear. Could I get some pointers, help or tips on this please? Thanks
-
- Posts: 854
- Joined: 21 Dec 2015, 02:34
Re: Creating a dot in the centre of the screen, toggleable on button hold
Hopefully this can get you started:
Code: Select all
diam = 60 ; diameter of dot
Gui -Caption +AlwaysOnTop
Gui margin,0,0
Gui add, ListView, w%diam% h%diam% -Hdr -E0x200 BackgroundRed
SysGet, mon, MonitorWorkArea ; get screen size (to include taskbar height delete text 'WorkArea')
Gui show, % "x" monRight//2-(diam//2) " y" monBottom//2-(diam//2), DOT
WinSet, Region, 0-0 W%diam% H%diam% E, A ; make it circular
return
~rbutton::
winhide, DOT
keywait, rbutton
winshow, DOT
Return
Re: Creating a dot in the centre of the screen, toggleable on button hold
Is there a way to do this without the winhide and winshow functions? As this is causing my game to go in and out of focusscriptor2016 wrote: ↑08 Feb 2020, 19:38Code: Select all
~rbutton:: winhide, DOT keywait, rbutton winshow, DOT Return
-
- Posts: 854
- Joined: 21 Dec 2015, 02:34
Re: Creating a dot in the centre of the screen, toggleable on button hold
I'm not sure why that's happening. Do you mean that your game is no longer the active window when right-clicking down and holding? Is some other window taking focus?
On my end, right-clicking hides the dot but does not affect the active window.
On my end, right-clicking hides the dot but does not affect the active window.
Who is online
Users browsing this forum: Google [Bot], zerox and 328 guests