Slideshow over one card portion

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gcubar
Posts: 2
Joined: Tue Apr 26, 2016 6:26 pm

Slideshow over one card portion

Post by gcubar » Wed Apr 27, 2016 2:56 pm

Hello colleagues,

I'm trying to do an application with a slideshow that changes every time automatically. I'm doing it on an image, locking the screen and using visual effect; however, I am having some problems with the application performance.

The slideshow works well and makes transitions in time and with the desired effect, but it frezzes the whole LiveCode IDE (which includes my application as well) when the image is changed.

I attached a sample code so they can see my problem. To start transitions is given a click on the "start" button and to stop him in the "stop" button. When the slideshow is running, and we begin scrolling the text of below field, it frezzes at the same time when the image will be changed. The same applies ever I try to write in the script editor whether the slideshow is activated.

Could this be a bug or is there something I'm going unnoticed in my code?

Beforehand thank you very much.

Gilberto Cuba Ricardo
Attachments
skSlideShow.zip
(162.88 KiB) Downloaded 182 times

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Slideshow over one card portion

Post by Klaus » Wed Apr 27, 2016 3:03 pm

Hola Gilberto,

1. welcome to the forum! :D
2. Without looking at your scripts: visual effects ARE in fact blocking!
Means during the effect everything halts/freezes, this is exspected behaviour
and we cannot do anything about it :(


Best

Klaus

gcubar
Posts: 2
Joined: Tue Apr 26, 2016 6:26 pm

Re: Slideshow over one card portion

Post by gcubar » Thu Apr 28, 2016 4:36 pm

Klaus wrote:Hola Gilberto,
1. welcome to the forum! :D
Thanks! and thanks again for your quick answer :D
Klaus wrote:2. Without looking at your scripts: visual effects ARE in fact blocking!
Means during the effect everything halts/freezes, this is exspected behaviour
and we cannot do anything about it :(
Excuse me, but i don't understand well; is the "visual effect" or the "lock screen" which blocks the IDE? Because, I use the lock screen for a region of card, and that's why i don't understand the reason for the IDE and entire screen freezes.

This is the script I have on the image that behave as slideshow.

Code: Select all

on automaticSlideShow
   
   if gShowSlide is not true then
      exit automaticSlideShow
   end if
   
   -- only lock a portion area of screen
   lock screen for visual effect in rect (the rect of me)
   
   -- iterate cyclically
   put lCurrentImage mod lTotalSlideImage into lCurrentImage
   add 1 to lCurrentImage
   
   -- exchange images 
   local tImageID
   put item lCurrentImage of gSlideImageIDs into tImageID
   put the image ID tImageID into the image "imgSlideShow"
   
   -- unlock with desired effect and velocity
   unlock screen with visual effect "dissolve" very fast
   
   -- launch automatic slideshow after desired time
   send "automaticSlideShow" to me in 3 secs 
end automaticSlideShow
At the end, if this is an expected behaviour as you say, how can I make a slideshow on a portion of card without freezes the rest of application's components?

Thanks,
Gilberto Cuba Ricardo

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Slideshow over one card portion

Post by Klaus » Thu Apr 28, 2016 5:09 pm

Hola Gilberto,
...is the "visual effect" or the "lock screen" which blocks the IDE?
it is the combination of both, but you cannot use a visual effect without "lock screen"!
and that's why i don't understand the reason for the IDE and entire screen freezes.
So do I, but that surely has technical reasons but we cannot do anything about it.
how can I make a slideshow on a portion of card without freezes the rest of application's components?
I'm afraid you can't if you want to use visual effects!


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Slideshow over one card portion

Post by dunbarx » Thu Apr 28, 2016 5:34 pm

Hi.

All Klaus said.

Know that simply locking the screen is not blocking. In fact this is used for just the opposite reason, to allow other processes to run without either slowing down the whole thing, or preventing the user from seeing those processes, or both.

But you raise an interesting question. How to run a visual effect without using a visual effect. You would have to roll your own. I can see ways of doing this. They all involve overlaying or insinuating other controls on top of each other and adjusting their rects, adjusting blend levels, that sort of thing. All kluges, but surely doable.

Are you game?

Craig Newman

Post Reply