Jump to content

how to stop images flashing as they show and hide


Arfur9
 Share

Recommended Posts

I'm trying to do a hidden objects game and I have a problem were for a split second as the image changes I get a white area as the image hides/shows, is there anyway to stop this?

this is the code I'm messing with

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Sound.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Form1", 800, 600, -1, -1)
$img="Backgroundalley.jpg"
$door ="door.jpg"
$dooropen = "dooropen.jpg"
$Pic1 = GUICtrlCreatePic($img, 0, 0, 800, 600)
GUICtrlSetState($Pic1, $GUI_DISABLE)
Local $aSound = _SoundOpen("machineClose.mp3")
$Pic3 = GUICtrlCreatePic($dooropen, 142, 6, 299, 540)
GUICtrlSetTip(-1, "Door")
GUICtrlSetOnEvent(-1, "Pic2Click")
GUICtrlSetState($Pic3,$GUI_HIDE)
$Pic2 = GUICtrlCreatePic($door, 142, 6, 299, 540)
GUICtrlSetTip(-1, "Door")
GUICtrlSetOnEvent(-1, "Pic1Click")
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "mainClose")
While 1
Sleep(100)
WEnd
Func mainClose()
$ExitDialog = MsgBox(36, "Are You Sure?", "Are you sure you want to exit?")
If $ExitDialog = 6 Then

Exit
Else
Return
EndIf
EndFunc ;==>mainClose

Func Pic1Click()
Sleep( 111)
GUICtrlSetState($Pic2, $GUI_HIDE)
GUICtrlSetState($Pic3, $GUI_SHOW)
;_SoundPlay($aSound, 1)
Return
EndFunc
Func Pic2Click()
GUICtrlSetState($Pic3, $GUI_HIDE)
Sleep( 1)
GUICtrlSetState($Pic2, $GUI_SHOW)
;_SoundPlay($aSound, 1)
Return
EndFunc

I've attached the images and file

game.zip

Edited by Arfur9
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...