Page 1 of 1

Refresh only part of the screen?

Posted: Mon Jan 17, 2022 5:26 pm
by M-A Kuttner
Hi all. I've got a card with a lot of elements on it and I need to display a number of sequential items as a little animation (showing and hiding primitive shapes) on one part of the card. With all of the other elements on screen, the refresh is pretty slow, so I'm hoping that redrawing only part of the screen will give me a boost. Is there a way to refresh only one area of the card and leave the rest alone?

BTW, I am currently using lock/unlock screen.

Thanks!
M-A

Re: Refresh only part of the screen?

Posted: Tue Jan 18, 2022 6:20 pm
by jacque
Check the dictionary for:

Code: Select all

lock screen for visual effect in rect <rectangle>

Re: Refresh only part of the screen?

Posted: Tue Jan 18, 2022 6:45 pm
by M-A Kuttner
Thank you Jacque. I gave that a try with the following code:

Code: Select all

lock screen for visual effect in rect (the rect of group "groupName")
(do stuff)
unlock screen with visual effect "plain" very fast
I also just tried plain old "unlock screen" at the end. Both methods played at the same speed as it was without specifying the rect.

That being the case, my solution is to open up a substack that contains only the elements I need to do the animation and play the animation in that window. This achieves the end of not updating what's in the main stack. This method sped up the animation display by about 2x.