On 4 May 2012 17:50, Martin Drautzburg <[email protected]> wrote: > Hello all, > > I am doing some smooth scrolling expriments. I use a step method in which I > adjust the display. When I set stepTime to 0, the time between steps is still > between 10 and 40 msces. During a scroll which takes 10 steps I see apx 1000 > redraws of fairly simple Morphs. That is 100 redraws per step. When an average > step takes apx. 20 msec this is 0.2 msec per redaw. Does this look normal, or > should I hunt for flaws in my program? > hard to say.. apparently every morph should be drawn only once per step. probably you mixing stepping and drawing/updating?
during stepping you should change some state, like advance the counters, do some calculations etc.. and then _just_ invalidate morphs which need to be redrawn, but do not draw them directly. (use "self changed" for morph ) then morphic will take care about redrawing things which are changed. > If this is the normal speed, then I cannot do animations in morphic, such that > I get a new frame every 14 msec (70 Hz), at least not the way I am trying to > do it. > > Another thing I cannot explain is the following: when I repeatedly call my > step method from another method (putting a Delay between the calls), the > display does not always update. I just see the end of the scroll, but not the > steps in between. Only when I add a World displayWorld I see the intermediate > scroll positions. However, when I call step from an explorer the Display > updates just fine, without an explicit displayWorld. Why is that so? > because of deferred updates. you should use Display forceToScreen to actually update the display. > -- > Martin > -- Best regards, Igor Stasenko.
