Results 1 to 2 of 2

Thread: Flying line........

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Wink

    I'm trying to create a screen saver, where a line flys on the screen!
    I have tried the following code, but after a few loops, the edges of the line disapear outside the screen, and so does the line after some time.....
    Does anyone know how to make a line fly INSIDE the screen??

    Code:
    Form1.Show
    Dim Scr
    For Scr = 1 To 1
    Do
    Line1.x1 = Line1.x1 + 34
    Line1.x2 = Line1.x2 - 45
    Line1.y1 = Line1.y1 + 24
    Line1.y2 = Line1.y2 + 15
    pausetime = 0.5
    start = Timer
    Do While Timer < start + pausetime
        DoEvents
    Loop
    Line1.x1 = Line1.x1 - 30
    Line1.x2 = Line1.x2 - 80
    Line1.y1 = Line1.y1 + 20
    Line1.y2 = Line1.y2 - 15
    
    pausetime = 0.5
    start = Timer
    Do While Timer < start + pausetime
        DoEvents
    Loop
    Line1.x1 = Line1.x1 + 300
    Line1.x2 = Line1.x2 - 80
    Line1.y1 = Line1.y1 - 20
    Line1.y2 = Line1.y2 + 150
    
    start = Timer
    Do While Timer < start + pausetime
        DoEvents
    Loop
    Line1.x1 = 4320
    Line1.x2 = 4320
    Line1.y1 = 2040
    Line1.y2 = 3720
    
    Loop
    Next Scr
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    I've used this to keep a form on the screen
    You should be able to doctor it to use on a control
    
    Option Explicit
       
    'you could do it this way / add a timer control
    
    Private Sub Form_Load()
        Timer1.Interval = 1
    End Sub
    
    Private Sub Timer1_Timer()
      If ((Form1.Left) < 0) Then Form1.Left = 0
      If ((Form1.Top) < 0) Then Form1.Top = 0
      If ((Form1.Left) > Screen.Width - Form1.Width) _
          Then Form1.Left = Screen.Width - Form1.Width
      If ((Form1.Top) > Screen.Height - Form1.Height) _
          Then Form1.Top = Screen.Height - Form1.Height
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width