Jump to content
Sign in to follow this  
toothyXdip

Constant Color Change

Recommended Posts

toothyXdip

Is there a way to make it where there is a constant loop of color change for a label without a ton of "If's" and does without the help of a button send


---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites
Valuater

Maybe... AdLib()

#include <GUIConstants.au3>

Dim $num

$Form = GUICreate("Demo")
$label = GUICtrlCreateLabel("Color changing text", 50, 150, 200, 20)
GUISetState(@SW_SHOW, $Form)

AdlibEnable("Color_Change", 500)

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
WEnd
    
Func Color_Change()
    $num += 1
    $color = StringSplit("0xfffafa,0xdcdcdc,0x000080,0xcd5c5c", ",")
    If $num > $color[0] Then $num = 1
    Return GUICtrlSetColor($label, $color[$num])
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
toothyXdip

thanks =)

yeah i dont really know how to use arrays or a lot of the functions yet so that might have helped lol

thanks again

P.S. i have a question about what is happening in this script ok so tell me where im wrong

the AdlibEnable is telling to evaluate the function colorchange every 500 milliseconds making it loop the colorchange

then is the $num +=1 telling it how fast to do the color changes in the StringSplit?

and the return is telling it what to make out of all of that and that is to change the color accordingly to the array returned from the StringSplit function?

0.o

Edited by toothyXdip

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites
Valuater

the AdlibEnable is telling to evaluate the function colorchange every 500 milliseconds making it loop the colorchange

Yes

then is the $num +=1 telling it how fast to do the color changes in the StringSplit?

Actually, the $num is telling which color to use next #1 through #5

and the return is telling it what to make out of all of that and that is to change the color accordingly to the array returned from the StringSplit function?

Yes, and if there is any error that will be sent too.

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
toothyXdip

thanks yeah i think im going to look up a array tut or read the whole array help files lol

well thanks again this and reading some of your other scrips has helped me to learn alot


---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites
therks

and the return is telling it what to make out of all of that and that is to change the color accordingly to the array returned from the StringSplit function?

Yes, and if there is any error that will be sent too.

???

How does that work? A return in an Adlib function doesn't do anything does it? Where is it returning the value to??

Share this post


Link to post
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
Sign in to follow this  

×