Jump to content

Help with background color


Wingens
 Share

Recommended Posts

Hi i am making a fullscreen program to open 2 game demo's for in the store that i am working in.

But i am not able to change the background color to black. Does any one know what i am doing wrong?

And maybe some one could tell me how i can get the pictures and the text to align in the center of the screen?

This is my code:

#include <GUIConstants.au3>

$DEMOGUI = GUICreate("Levix Demo",@DesktopWidth,@DesktopHeight,0,0,0x80000000)

GUICtrlSetBkColor(-1, 0x000000)

GUISetFont(8, 400, 4, "MS Sans Serif")

$HAWXLOGO = GUICtrlCreatePic("hawx 2.jpg", 72, 96, 260, 260)

$NFSLOGO = GUICtrlCreatePic("nfslogo.JPG", 432, 160, 212, 132)

$Tom1 = GUICtrlCreateLabel("Start", 176, 368, 40, 28)

GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif")

GUICtrlSetColor(-1, 0xff0000)

$Tom2 = GUICtrlCreateLabel("Tom Clancy's Hawx", 112, 392, 171, 28)

GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif")

GUICtrlSetColor(-1, 0xff0000)

$NFS1 = GUICtrlCreateLabel("Start", 520, 368, 40, 28)

GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif")

GUICtrlSetColor(-1, 0xff0000)

$NFS2 = GUICtrlCreateLabel("Need for Speed - Shift", 448, 392, 189, 28)

GUICtrlSetFont(-1, 14, 400, 4, "MS Sans Serif")

GUICtrlSetColor(-1, 0xff0000)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $HAWXLOGO

HAWXLOGO()

Case $TOM1

TOM1()

Case $TOM2

TOM2()

Case $NFSLOGO

NFSLOGO()

Case $NFS1

NFS1()

Case $NFS2

NFS2()

;Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

; ================================================================================

; ================================================================================

; Tom Clancy's Hawx

Func HAWXLOGO()

Run("C:\Program Files (x86)\Ubisoft\Demo\Tom Clancy's H.A.W.X\HAWX.exe")

EndFunc

; ================================================================================

Func TOM1()

Run("C:\Program Files (x86)\Ubisoft\Demo\Tom Clancy's H.A.W.X\HAWX.exe")

EndFunc

; ================================================================================

Func TOM2()

Run("C:\Program Files (x86)\Ubisoft\Demo\Tom Clancy's H.A.W.X\HAWX.exe")

EndFunc

; ================================================================================

; ================================================================================

;Need for Speed - Shift

Func NFSLOGO()

Run("C:\Program Files (x86)\Electronic Arts\Need for Speed SHIFT Demo\shiftdemo.exe")

EndFunc

; ================================================================================

Func NFS1()

Run("C:\Program Files (x86)\Electronic Arts\Need for Speed SHIFT Demo\shiftdemo.exe")

EndFunc

; ================================================================================

Func NFS2()

Run("C:\Program Files (x86)\Electronic Arts\Need for Speed SHIFT Demo\shiftdemo.exe")

EndFunc

; ================================================================================

; ================================================================================

Edited by Wingens
Link to comment
Share on other sites

If you want your images and text to be center of the screen regardless of desktop size then you need you make your guictrl x , y relative to your @desktopwidth and @desktopheight.

EG:

$Tom1 = GUICtrlCreateLabel("Start", @DesktopWidth/2, @desktopheight/2, 40, 28) ;will be center of any screen it is run on

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

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...