AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Credits [function]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
haichen



Joined: 05 Feb 2007
Posts: 110
Location: Osnabrück, Germany

PostPosted: Tue Apr 08, 2008 4:46 pm    Post subject: Credits [function] Reply with quote

I found a Credits window in Compile_AHK II and in this post Credits Gui. Because I liked it and found it useful I made a function out of it:

To use it, make a Gui and add credits afterwards.

    credits(WinTitel,Yend=0,repeat=1,GuiID=1)

WinTitel: Name of the Credits window
Yend: an Offset for the animation
Repeat: nothing more to say
GuiId: Windows number

Code:
  Gui, Add, Button,     gAbout    ,show Credit
  Gui, Show, y10 w100 h50,Main
Return

about:
  titel= Credits:
  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,55: +ToolWindow +AlwaysOnTop
  Gui,55: Margin, 0, 0
  Gui,55: Add, Picture, vIcon1 x10  h16 w16 Icon44, shell32.dll
  Gui,55: Add, Text,    vText1 yp+0 x30, Chris
  Gui,55: Add, Picture, vIcon  x10  h16 w16 Icon13, shell32.dll
  Gui,55: Add, Text,    vText2 yp+0 x30, TiTan
  Gui,55: Add, Picture, vIcon3 x10  h16 w16 Icon95, shell32.dll
  Gui,55: Add, Text,    vText3 yp+0 x30, Jane Doe
  Gui,55: Add, Text,    vText4 yp+30 x10, %TestText%
  Gui,55: Add, Button,   g55GuiClose      x250,test
  Gui,55: Add, Text,    vText5 yp+0 x10, made by haichen
  Gui,55: Add, Text,    vText6 x10, 2008
  Gui,55: Show,  h255 ,%titel%
  credits(titel,70,1,55)
Return

credits(WinTitel,Yend=0,repeat=1,GuiID=1){
    global
    Gui, Submit, NoHide
    test  := WinExist(WinTitel)
    WinGetPos,,,WinW,WinH,%WinTitel%
    WinGet, ActiveControlList, ControlList,%WinTitel%

    ctr=0
    Loop, Parse, ActiveControlList, `n,%a_Space%
    {
      ctr++
      GuiControlGet GC%a_index%Pos, %GuiID%:Pos,%A_LoopField%
      If (GC%a_index%PosY<>"")and(GC%a_index%PosY>0)
        LastPos := GC%a_index%PosY
      If (A_LoopField="autoHotkeyGui1") or (A_LoopField="ReBarWindow321")
        GC%a_index%PosY = 0
      tGC%a_index%PosY := GC%a_index%PosY
    }
    IfWinNotExist ahk_id %test%
      Return
    Loop,%Repeat%
    {
       sleep,2000
      Loop,% LastPos -Yend
      {
        i=0
        Loop, Parse, ActiveControlList, `n
        {
          i++
          GC%i%PosY--
          PosY:= GC%i%PosY
          GuiControl %GuiID%:Move ,%A_LoopField%, y%PosY%
        }
        Sleep 50
        IfWinNotExist ahk_id %test%
          Return
      }
      Sleep 15000
      Loop, %ctr%
        GC%a_index%PosY:= tGC%a_index%PosY
    }
    Gui,%GuiID%:Destroy
    Return
  }

55GuiClose:
  Gui, 55:Destroy
Return


GuiEscape:
GuiClose:
  ExitApp




Last edited by haichen on Fri Apr 11, 2008 6:11 pm; edited 2 times in total
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 110
Location: Osnabrück, Germany

PostPosted: Fri Apr 11, 2008 11:31 am    Post subject: Reply with quote

I corrected some small errors wich came by interacting with some other functions and controls (ReBar).
In the first version the text run into the window from below.
Now it runs out of the Gui.
Back to top
View user's profile Send private message
HugoV



Joined: 27 May 2007
Posts: 495

PostPosted: Fri Apr 11, 2008 1:58 pm    Post subject: Reply with quote

Error with the script above:
Quote:
Error: Target label does not exist. The current thread will exit.
Specifically: g55GuiClose
Line#
033: Gui,55: Add,Text,vText4 yp+30 x10,%TestText%
---> 034: Gui,55: Add,Button,g55GuiClose,test
035: Gui,55: Add,Text,vText5 yp+0 x10,made by haichen
036: Gui,55: Add,Text,vText6 x10,2008
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 110
Location: Osnabrück, Germany

PostPosted: Fri Apr 11, 2008 2:48 pm    Post subject: Reply with quote

Forgot to copy some lines. Sorry.
Corrected now.
Back to top
View user's profile Send private message
widow
Guest





PostPosted: Tue Apr 15, 2008 3:57 am    Post subject: Reply with quote

I dont like it
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group