Sign in to follow this  
Followers 0
Rad

Marquee-ing labels/inputs

9 posts in this topic

I made a pretty cheesy way to make the text scroll across a label, one letter at a time... it looks really blocky though, I was wondering if anyone's ever thought of a way or knows a way to make the text move smoothly across... If you open WMP and use the compact skin (the blue/silver with black center), the title of a song scrolls across it smoothly.

I've also seen it done with a few cdkey generators, but I dont know how.

Just wondering if its possible

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Quick and dirty:

AdlibEnable('_MoveMarquee', 100)

Global $mygui = GUICreate('my gui', 200, 100)
Global $myl = GUICtrlCreateLabel('Some Text To Show', 0, 10, 150, 20)
GUISetState()
While GUIGetMsg() <> -3
WEnd

Func _MoveMarquee()
    Local $aCpos = ControlGetPos($mygui, '', $myl)
    If $aCpos[0] >= 200 Then $aCpos[0] = 0
    ControlMove($mygui, '', $myl, $aCpos[0] + 10, $aCpos[1])
EndFuncoÝ÷ ØGb´KÞxz¶®¶­sdFÆ$Væ&ÆRb33µôÖ÷fTÖ'VVRb33²Â ¤vÆö&Âb33c¶×wVÒuT7&VFRb33¶×wVb33²Â#¤vÆö&Âb33c¶×ÂÒuT7G&Ä7&VFTÆ&VÂb33µ6öÖRFWBFò6÷rb33²ÂÂÂSÂ#¤uT6WE7FFR¥vÆRuTvWD×6rfÇC²fwC²Ó0¥tVæ@ ¤gVæ2ôÖ÷fTÖ'VVR Æö6Âb33c¶7÷2Ò6öçG&öÄvWE÷2b33c¶×wVÂb33²b33²Âb33c¶× bb33c¶7÷5³ÒfwC³Ò#FVâb33c¶7÷5³ÒÒ 6öçG&öÄÖ÷fRb33c¶×wVÂb33²b33²Âb33c¶×ÂÂb33c¶7÷5³Ò²Âb33c¶7÷5³Ò¤VæDgVæ0

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Is there any way to like... mount this as a background, so I can put labels over it? And pictures

Because heres my program, and the top left one that says "ish - W i s h m a s t e r" is whats scrolling. Im actually scrolling the text, not the control, though

Posted Image

I really wish there were control layers

Edited by Rad

Share this post


Link to post
Share on other sites

Is there any way to like... mount this as a background, so I can put labels over it? And pictures

Because heres my program, and the top left one that says "ish - W i s h m a s t e r" is whats scrolling. Im actually scrolling the text, not the control, though

Posted Image

I really wish there were control layers

Make it a control, and disable the control behind it.

[center]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.[/center]

Share this post


Link to post
Share on other sites

This is close to what you are saying "I think"

AdlibEnable('_MoveMarquee', 10)

Global $mygui = GUICreate('my gui', 200, 100)
$myI = GUICtrlCreateInput('', 0, 10, 200, 17)
GUICtrlSendMsg($myI, 0xCF, True, 0)
GUICtrlSetBkColor($myI, 0xFFFFFF)
GUICtrlSetState($myI, 128)
Global $myl = GUICtrlCreateLabel('Some Text To Show', 0, 10, 150, 17)
GUICtrlSetBkColor($myl, -2)
GUISetState()
While GUIGetMsg() <> -3
WEnd

Func _MoveMarquee()
    Local $aCpos = ControlGetPos($mygui, '', $myl)
    If $aCpos[0] >= 200 Then $aCpos[0] = 0
    ControlMove($mygui, '', $myl, $aCpos[0] + 1, $aCpos[1])
EndFunc
Exit


[center]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.[/center]

Share this post


Link to post
Share on other sites

I looked at that, thats basically what I did except i made it scroll from left to right and back again. The examples with that are only "move in from left/right" "move out from left/right". Plus, it writes itself in... In mine it just changes the text to appear like its moving

Example:

Nightwish - Wishmaster

ightwish - Wishmaster N

ghtwish - Wishmaster Ni

...

shmaster Nightwish - Wi

etc.

Here ill attach it for you so you can look, the source is really long from all of the button codes, and it probrably wouldnt make sense unless you compare it to my UDF's in Rad.au3 - i suggest you extract all files to a folder, and just run the .exe to see what I mean, it will be obvious

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I was looking for something like this, and this will work pretty well. I do have one question. How do you make it so it looks like it starts compleatly from the left showing the end of the statement first, then the rest of the string. What I mean is currently the scroll starts by showing the entire string. In other words, how do you get it to enter stage left, exit stage right?

Edit: I figured it out:

AdlibEnable('_MoveMarquee', 10)
$size = 300
$text = 150
Global $mygui = GUICreate('my gui', $size, 70)
Global $myl = GUICtrlCreateLabel('Some Text To Show', 0, 10, $text, 20)
GUISetState()
While GUIGetMsg() <> -3
WEnd

Func _MoveMarquee()
    Local $aCpos = ControlGetPos($mygui, '', $myl)
    If $aCpos[0] >= $size Then $aCpos[0] = -$text
    ControlMove($mygui, '', $myl, $aCpos[0] + 1, $aCpos[1])
EndFunc
Edited by Volly

Share this post


Link to post
Share on other sites

I was looking for something like this, and this will work pretty well. I do have one question. How do you make it so it looks like it starts compleatly from the left showing the end of the statement first, then the rest of the string. What I mean is currently the scroll starts by showing the entire string. In other words, how do you get it to enter stage left, exit stage right?

Edit: I figured it out:

AdlibEnable('_MoveMarquee', 10)
$size = 300
$text = 150
Global $mygui = GUICreate('my gui', $size, 70)
Global $myl = GUICtrlCreateLabel('Some Text To Show', 0, 10, $text, 20)
GUISetState()
While GUIGetMsg() <> -3
WEnd

Func _MoveMarquee()
    Local $aCpos = ControlGetPos($mygui, '', $myl)
    If $aCpos[0] >= $size Then $aCpos[0] = -$text
    ControlMove($mygui, '', $myl, $aCpos[0] + 1, $aCpos[1])
EndFunc
If You create your label at -$text rather than 0 it looks better to start with.

$size = 300
$text = 150
Global $mygui = GUICreate('my gui', $size, 70)
Global $myl = GUICtrlCreateLabel('Some Text To Show', -$text, 10, $text, 20)
GUISetState()
AdlibEnable('_MoveMarquee', 10)
While GUIGetMsg() <> -3
WEnd

Func _MoveMarquee()
    Local $aCpos = ControlGetPos($mygui, '', $myl)
    If $aCpos[0] >= $size Then $aCpos[0] = -$text
    ControlMove($mygui, '', $myl, $aCpos[0] + 1, $aCpos[1])
EndFunc

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  
Followers 0