Smooth out movement of script in DesktopX

Tuesday, October 28, 2008 by Richard Mohler | Discussion: DesktopX

Does anyone know how to smooth out the movement of a script in DX? It's hidden & when it rolls down from the top it's always kind of jerky. Anyway to smooth out? Any suggestions?

bilbo1930
Reply #1 Wednesday, October 29, 2008 1:22 AM

What script use Richard?

Richard Mohler
Reply #2 Wednesday, October 29, 2008 11:23 AM

Here it is...

Sub Object_OnScriptEnter
  desktopx.Object("panel_back").top = -360
End Sub
Sub Object_OnStateChange(state)
 If state = "Command executed" Then
   DesktopX.Object("panel_back").Visible = True
 End If
End Sub
Function Object_OnLButtonUp(x, y, Dragged) 
  If Dragged = False Then
    If desktopx.Object("panel_back").top = 0 Then
      object.KillTimer 10
      object.SetTimer 20,8
    Else
      object.KillTimer 20
      object.SetTimer 10,8
    End If
  End If
End Function

Sub object_ontimer10
  If desktopx.Object("panel_back").top < 0 Then
    desktopx.Object("panel_back").top = desktopx.Object("panel_back").top + 8
  Else
    object.KillTimer 10
  End If
End Sub

Sub object_ontimer20
  If desktopx.Object("panel_back").top > -360 Then
    desktopx.Object("panel_back").top = desktopx.Object("panel_back").top - 8
  Else
    object.KillTimer 20
  End If
End Sub

BigDogBigFeet
Reply #3 Wednesday, October 29, 2008 11:43 AM

desktopx.Object("panel_back").top = desktopx.Object("panel_back").top + 8

Try changing the above to: desktopx.Object("panel_back").top = desktopx.Object("panel_back").top + 2 also change

desktopx.Object("panel_back").top = desktopx.Object("panel_back").top - 8

to: desktopx.Object("panel_back").top = desktopx.Object("panel_back").top - 2

That should improve the smoothness.  You can also reduce the number to 1 instead of 2.

 

bilbo1930
Reply #4 Wednesday, October 29, 2008 12:01 PM

Yeah, agree with BDBF, that should work

Richard Mohler
Reply #5 Wednesday, October 29, 2008 6:38 PM

Thanks guys..

RomanDA
Reply #6 Wednesday, October 29, 2008 7:18 PM

thats the key or make the timer faster if that is too slow

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01