YPosIcon1 = 97 YPosIcon2 = 97 YPosIcon3 = 97 YPosIcon4 = 97 TestText = (LTrim Producer:`t`tMom`n AssistantProducer:`tDad`n Sound:`t`t`tBaby`n This will go on for a while. Believe me. It's not worth reading on. C'mon - quit now. Close the gui`n Hello?`n`n It's useless reading on.`n`n Oh look how nice it scrolls So you wanted it. I'll close the gui for you.`n`n`n`n`n`n BYE ) If ( A_OSType = "WIN32_WINDOWS" ) ; Windows 9x DefaultItem = %A_WinDir%\system\shell32.dll Else DefaultItem = %A_WinDir%\system32\shell32.dll Gui +ToolWindow +AlwaysOnTop Gui, Margin, 0, 0 Gui, Add, Picture, vIcon1 x72 ym+95 h16 w16 Icon44 AltSubmit, %DefaultItem% Gui, Add, Text, vText1 x90 ym+95 , Chris Gui, Add, Picture, vIcon2 x72 ym+95 h16 w16 Icon13 AltSubmit, %DefaultItem% Gui, Add, Text, vText2 x95 ym+95, John Doe Gui, Add, Picture, vIcon3 x72 ym+95 h16 w16 Icon95 AltSubmit, %DefaultItem% Gui, Add, Text, vText3 x95 ym+95, Jane Doe Gui, Add, Text, vText4 x23 ym+95, %TestText% Gui, Add, GroupBox, xm ym-6 w189 h100 Gui, Show, w189 h93, Credits: GoSub, ScrollUp Return GuiClose: ExitApp ScrollUp: Loop, 264 { If A_Index <=55 { YPosIcon1 -= 2 GuiControl, Move, Icon1, x72 y%YPosIcon1% GuiControl, Move, Text1, x90 y%YPosIcon1% } If (A_Index >= 27) AND (A_Index <= 82) { YPosIcon2 -= 2 GuiControl, Move, Icon2, x72 y%YPosIcon2% GuiControl, Move, Text2, x90 y%YPosIcon2% } If (A_Index >= 54) AND (A_Index <= 109) { YPosIcon3 -= 2 GuiControl, Move, Icon3, x72 y%YPosIcon3% GuiControl, Move, Text3, x90 y%YPosIcon3% } If (A_Index >= 78) AND (A_Index <= 262) { YPosIcon4 -= 2 GuiControl, Move, Text4, y%YPosIcon4% } If (A_Index = 264) { GoSub, GuiClose } Sleep, 150 } Return
Credits GUI
Started by
AGU
, Dec 06 2005 08:03 AM
8 replies to this topic
Don't know if s.th like this has been done before. But here is a credits gui I recently made. :mrgreen:
#1
-
Posted 06 December 2005 - 08:03 AM
hello AGU,
didn't realise , how it works, must work on it (when have time)
very nice
I'll close the gui for you
didn't realise , how it works, must work on it (when have time)
very nice
I'll close the gui for you
#2
-
Posted 06 December 2005 - 08:33 AM
Nice! Still, I suggest a few improvements:
- There is no need for using A_Index to determine if some text is visible, we can still move it
- It is more general to test if the last block of text has scrolled up fully, end exit then
- There seem to be no reason for the GroupBox being there
- The ScrollUp subroutine is called only once, so we can just copy it to the right place
- Wait a second before exit, so the user can read the last line
- shell32.dll should be found via the Path, no need to fully specify its location.
The version below is more general, you can freely edit the main block of text, it will be shown correctly. In the beginning you can set the height of the GUI window and the gaps between the 4 main blocks of information. If you need fewer or more, you have to edit the script in a straightforward way.
- There is no need for using A_Index to determine if some text is visible, we can still move it
- It is more general to test if the last block of text has scrolled up fully, end exit then
- There seem to be no reason for the GroupBox being there
- The ScrollUp subroutine is called only once, so we can just copy it to the right place
- Wait a second before exit, so the user can read the last line
- shell32.dll should be found via the Path, no need to fully specify its location.
The version below is more general, you can freely edit the main block of text, it will be shown correctly. In the beginning you can set the height of the GUI window and the gaps between the 4 main blocks of information. If you need fewer or more, you have to edit the script in a straightforward way.
WinH = 99 ; Height of GUI YPos1 := WinH - 10 ; Bottom of GUI Window YPos2 := YPos1 + 60 ; 60 pixels gap YPos3 := YPos2 + 60 YPos4 := YPos3 + 70 TestText = (LTrim Producer:`t`tMom`n AssistantProducer:`tDad`n Sound:`t`t`tBaby`n This will go on for a while. Believe me. It's not worth reading on. C'mon - quit now. Close the gui`n Hello?`n`n It's useless reading on.`n`n Oh look how nice it scrolls So you wanted it. I'll close the gui for you.`n`n`n`n BYE ) Gui +ToolWindow +AlwaysOnTop Gui Margin, 0, 0 Gui Add, Picture, vIcon1 x12 y%YPos1% h16 w16 Icon44, shell32.dll Gui Add, Text, vText1 x30, Chris Gui Add, Picture, vIcon2 x12 y%YPos2% h16 w16 Icon13, shell32.dll Gui Add, Text, vText2 x30, John Doe Gui Add, Picture, vIcon3 x12 y%YPos3% h16 w16 Icon95, shell32.dll Gui Add, Text, vText3 x30, Jane Doe Gui Add, Text, vText4 x5 y%YPos1%, %TestText% Gui Show, w189 h%WinH%, Credits: Loop { YPos1-- GuiControl Move, Icon1, y%YPos1% GuiControl Move, Text1, y%YPos1% YPos2-- GuiControl Move, Icon2, y%YPos2% GuiControl Move, Text2, y%YPos2% YPos3-- GuiControl Move, Icon3, y%YPos3% GuiControl Move, Text3, y%YPos3% YPos4-- GuiControl Move, Text4, y%YPos4% GuiControlGet Text4, Pos If (text4Y + text4H < WinH) Break Sleep 50 } Sleep 1000 GuiEscape: GuiClose: ExitApp
#3
-
Posted 06 December 2005 - 05:37 PM
*sigh* I love optimized code. :mrgreen: Thx Laszlo
Tried to study the gui commmand docs but can't find a passage describing the effects of attaching "Y" and "H" to a control name.
Right. It forgot to remove it. I planned to make Gui, -Caption and therefore a little frame might have looked good, but in the end I thought it won't be good to remove the Close Button.There seem to be no reason for the GroupBox being there
... If (text4Y + text4H < WinH) Break ...Could you give me a hint what you have done here? I can't see that text4Y variable is defined anywhere. Nevertheless it's working and it holds a value.
Tried to study the gui commmand docs but can't find a passage describing the effects of attaching "Y" and "H" to a control name.
#4
-
Posted 06 December 2005 - 07:51 PM
GuiControlGet Var, Pos sets 4 variables: VarX, VarY, VarW, VarH
#5
-
Posted 06 December 2005 - 07:55 PM
Can you use a txt file to read from for the credits info?
#6
-
Posted 07 December 2005 - 02:47 PM
The TestText variable can be set by ReadFile, IniRead or as you like. The first 3 scrolling lines (not in the TestText) are a bit more involved, because you need to supply the icons. If you don't need those, just delete the corresponding lines from the script.
#7
-
Posted 07 December 2005 - 04:48 PM
Hi together.I have a problem.because i wantd that my credit running in a endless loop.but i dont know how to fix it.please excause me but my english isnt very good *smile* :-)Greetings CreaTOR
here is the code of the credit that have to run in a endless loop:
Here is the pic that u need for the script:
http://www.evardnet....&file=intro.bmp
here is the code of the credit that have to run in a endless loop:
WinH = 529 ; Height of GUI YPos1 := WinH - 10 ; Bottom of GUI Window YPos2 := YPos1 + 530 ; 60 pixels gap Gui +ToolWindow +AlwaysOnTop Gui Margin, 0, 0 Gui, color, #000000 Gui Add, Picture, vIcon1 x0 y%YPos1% h529 w178 , intro.bmp Gui Add, Picture, vIcon2 x0 y%YPos2% h529 w178 , intro.bmp Gui Show, w178 h%WinH%, Credits: loop, { YPos1-- GuiControl Move, Icon1, y%YPos1% YPos2-- GuiControl Move, Icon2, y%YPos2% GuiControlGet Icon2, Pos If (icon2Y + icon2H < WinH) break sleep, 5 } sleep, 1000 GuiEscape: GuiClose: ExitApp
Here is the pic that u need for the script:
http://www.evardnet....&file=intro.bmp
#8
-
Posted 19 August 2006 - 07:20 PM
Change the loop as follows:
loop, { YPos1-- If Ypos1 < -530 YPos1 := WinH - 10 GuiControl Move, Icon1, y%YPos1% YPos2-- If Ypos2 < -530 YPos2 := WinH - 10 GuiControl Move, Icon2, y%YPos2% GuiControlGet Icon2, Pos sleep, 5 }
#9
-
Posted 19 August 2006 - 08:32 PM