Jump to content

GUI on top of full-screen game


Lambort
 Share

Recommended Posts

Global $Paused
HotKeySet("{F8}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
$MainGUI = GUICreate("xhair", 3, 3, @DesktopWidth/2, @DesktopHeight/2, $WS_POPUP, $WS_EX_TOOLWINDOW)    
GUISetBkColor (0x00FF00)                                                                                
WinSetOnTop ("xhair", "", 1)                                                                            
WinSetTrans("xhair", "", 250)

guisetstate()
While 1
Wend


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        GUISetState ( @SW_HIDE )
    WEnd
        GUISetState ( @SW_SHOW )
EndFunc


Func Terminate()
    Exit 0
EndFunc

As you can see it should be on top of everything else that is currently running. It works on the desktop but as soon as I open up my full-screen game it doesn't show the box overtop of the game. Any idea on how to get it to show up over the full-screen application?

Edited by Lambort
Link to comment
Share on other sites

From what I know, it is not really possible to do this with autoit.

Now, it depends how much of a GUI you want to make. I have not jet tested it, but I think that you can have a tooltip active on your mouse when you have a game in window mode. So.. if you want just to display some info and things like that, without having the need to put in data, you can make all this by making a tooltip in that you can display various data.

I personally am using tooltips on the game macros that i make to that I do not get bored if I look at them, get the state in that they are... and how much they have progressed, and of course for debugging.

Link to comment
Share on other sites

From what I know, it is not really possible to do this with autoit.

Now, it depends how much of a GUI you want to make. I have not jet tested it, but I think that you can have a tooltip active on your mouse when you have a game in window mode. So.. if you want just to display some info and things like that, without having the need to put in data, you can make all this by making a tooltip in that you can display various data.

I personally am using tooltips on the game macros that i make to that I do not get bored if I look at them, get the state in that they are... and how much they have progressed, and of course for debugging.

Hmm, well.. I've tried a couple more things with this. Splash screen doesn't work over top of the game here is what i tried:

#include <GUIConstants.au3>

Global $Paused
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F8}", "TogglePause")



GLOBAL $MESSAGE = ""
GUICreate(":xhair: - By Mayonnaise",55, 280, -1, -1, $WS_EX_TOOLWINDOW); will create a dialog box that when displayed is centered

GUICtrlCreateLabel( "Select your xhair", 21, 2, 100, 25, -1)
GUICtrlCreateLabel( "and press Go!", 21, 14, 100, 25, -1)
GUICtrlCreateLabel( "Hotkeys are:", 21, 29, 100, 25, -1)
GUICtrlCreateLabel( "F8 - On/Off", 21, 43, 100, 25, -1)
GUICtrlCreateLabel( "Esc - Exit", 21, 55, 100, 25, -1)
GUICtrlCreateLabel( "Made By: Mayonnaise", 6, 225, 200, 25, -1)
$Red=GUICtrlCreateButton ("Red", 21,74,75,25)
$Green=GUICtrlCreateButton ("Green", 21,99,75,25)
$MyList=GUICtrlCreateLabel( "", 300, 50, 100, 25, -1)
GUICtrlSetLimit(-1,200); to limit horizontal scrolling
GUICtrlSetData(-1,$MESSAGE)
$Blue = GUICtrlCreateButton ("Blue", 21,127,75,25)
$Go = GUICtrlCreateButton ("Go!", 21,187,75,25)
$White=GUICtrlCreateButton ("White", 21,153,75,25)

GUISetState ()

$msg = 0

While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()

Select
Case $msg = $Red
SplashImageOn ( "xhair", "red.bmp", 9, 9, @DesktopWidth/2, @DesktopHeight/2, 1 )
WinSetState ( "xhair", "", @SW_HIDE )
MsgBox(0x0, "Loaded!", "The red crosshair has been loaded.")
Case $msg = $Green
SplashImageOn ( "xhair", "green.bmp", 9, 9, @DesktopWidth/2, @DesktopHeight/2, 1 )
WinSetState ( "xhair", "", @SW_HIDE )
MsgBox(0x0, "Loaded!", "The green crosshair has been loaded.")
Case $msg = $Blue
SplashImageOn ( "xhair", "blue.bmp", 9, 9, @DesktopWidth/2, @DesktopHeight/2, 1 )
WinSetState ( "xhair", "", @SW_HIDE )
MsgBox(0x0, "Loaded!", "The blue crosshair has been loaded.")
Case $msg = $White
SplashImageOn ( "xhair", "white.bmp", 9, 9, @DesktopWidth/2, @DesktopHeight/2, 1 )
WinSetState ( "xhair", "", @SW_HIDE )
MsgBox(0x0, "Loaded!", "The white crosshair has been loaded.")
Case $msg = $Go
WinSetState ( ":xhair: - By Mayonnaise", "", @SW_HIDE )
EndSelect
Wend


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        WinSetState ( "xhair", "", @SW_SHOW )
    WEnd
        WinSetState( "xhair", "", @SW_HIDE )
    EndFunc


Func Terminate()
    Exit 0
EndFunc

I'm working with the tooltip now, here is what I have so far with it:

#include <GuiConstants.au3>

Global $Paused
HotKeySet("{F8}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
$MainGUI = ToolTip("+", @DesktopWidth/2, @DesktopHeight/2, "", 0)
Sleep(20000)
GUISetBkColor (0x00FF00)
WinSetOnTop ("xhair", "", 1)
WinSetTrans("xhair", "", 250)

guisetstate()
While 1
Wend


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip("+", @DesktopWidth/2, @DesktopHeight/2, "", 0)
    WEnd
        ToolTip("")
EndFunc


Func Terminate()
    Exit 0
EndFunc

So my questions are:

1. Is there any way to make the splash image work over the game?

2. Is there a way to customize the tooltip window size, background color, and text color?

and

3. Can you get rid of the shadow tooltip casts?

Edited by Lambort
Link to comment
Share on other sites

  • Moderators

What do you think your full screen game does when it goes full screen? I would guess this (and have said it many times in the same subject of this thread) that they themselves set WinSetOnTop so to speak. Even if you could get a window to the top, as soon as your full screen game lost focus, it would more than likely minimize or destroy it's window.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

What do you think your full screen game does when it goes full screen? I would guess this (and have said it many times in the same subject of this thread) that they themselves set WinSetOnTop so to speak. Even if you could get a window to the top, as soon as your full screen game lost focus, it would more than likely minimize or destroy it's window.

Yeah, it does minimize, I suppose the only solution is to get a tooltip working correctly, even if it flickers that's ok, if I can just get it dead center. I also noticed with my tooltip the game shows my cursor through the game. Any way to hide or remove the tooltip with it created so just the cursor shows through?

Edited by Lambort
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...