Smooth out movement of script in 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?

2,937 views 6 replies
Reply #1 Top

What script use Richard?

Reply #2 Top

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

Reply #3 Top

desktopx.Object("panel_back").top = desktopx.Object("panel_back").top + 8
End of quote

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
End of quote

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.

 

Reply #4 Top

Yeah, agree with BDBF, that should work :)

Reply #6 Top

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