Refresh only part of the screen?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
M-A Kuttner
Posts: 49
Joined: Mon Apr 03, 2017 3:55 pm
Location: Nova Scotia, Canada

Refresh only part of the screen?

Post by M-A Kuttner » Mon Jan 17, 2022 5:26 pm

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
Hypertalk developer on and off since the days of SuperCard. Currently using LC to do rapid prototyping for a new kids' toy.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7235
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Refresh only part of the screen?

Post by jacque » Tue Jan 18, 2022 6:20 pm

Check the dictionary for:

Code: Select all

lock screen for visual effect in rect <rectangle>
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

M-A Kuttner
Posts: 49
Joined: Mon Apr 03, 2017 3:55 pm
Location: Nova Scotia, Canada

Re: Refresh only part of the screen?

Post by M-A Kuttner » Tue Jan 18, 2022 6:45 pm

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.
Hypertalk developer on and off since the days of SuperCard. Currently using LC to do rapid prototyping for a new kids' toy.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”