iOS Question smoother movements

tufanv

Expert
Licensed User
Longtime User
Hello

I have a basic menu button. When i click it , sidepanel comes from the left with the help of a timer with interval 1. With each tick the panel moves to right with value 1. The sliding panel is not moving too much smoothly, it makes some lags. Is there any possible way to make it smoother ?

TY
 

narek adonts

Well-Known Member
Licensed User
Longtime User
Try to use the class attached. it ticks on each screen refresh so it will be smooth.

You can use it as a timer.

B4X:
dim tmr as CADisplayLink

tmr.initialize("tmr",me)
tmr.Enabled=true

Sub tmr_refresh

' each screen refresh

end Sub


You can customize it to tick on your desired interval with tmr.TimeStamp calculations
 

Attachments

  • CADisplayLink.bas
    1.6 KB · Views: 263
Upvote 0

tufanv

Expert
Licensed User
Longtime User
It is attached to post #2
now i tried it. Yes it is very smooth. What i couldnt manage is to calculate timestamp . When i start the animation, my left menu starts to slide to right but slowly(slower than a timer with interval 1 ). Can i make it faster like a timer with interval 1 ?
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top