Run processes/effects simultaneously with a visual effect ?

Sannyasin Brahmanathaswami brahma at hindu.org
Thu Jan 26 13:09:36 EST 2017


I'm looking to "dress" up our new app with more elegant visuals.

I was using send in time to a handle that changes the blendlevel of small objects… this works well and is none blocking.

But someone asked "Why don't you just use dissolve?"

Duh.. the dictionary doesn't give the platforms that work with dissolve but apparently, it runs just fine on iOS and Android.

So,  I did some tests…wondering about the engine's timing work with visual effects:

create stack
place image
put two buttons "hide"  "show" and one field "bool"

Btn 1:
on mouseUp
put empty into fld "bool"
hide image burger with visual effect dissolve very slowly
put "false" into fld "bool"
answer "Are U Hidden Yet?" with "Yes" or "No"
end mouseUp

btn 2:
on mouseUp
put empty into fld "bool"
show image burger with visual effect dissolve very slowly
put "true" into fld "bool"
answer "Are U Showing Yet?" with "Yes" or "No"
end mouseUp

that visual effect is blocking. The commands that follow do not run until the visual effect is done, effectively visual effect is a "wait"

Also the dictionary says if you put two visual effects one after another they run consecutively.

but what if you want 2 visual effects to run simultaneously  and also have another process (like type txt or invoke a dialog etc) occur at the same time?

typical example:, let's say I want to create a cross fade between two images. The show and hide for each one with dissolve would need to run simultaneously.  I'm using "very slowly" for testing, in a real app we would probably use very fast or fast.

img 1: "burger:
img 2: "shot"

on mouseUp
hide image burger with visual effect dissolve very slowly
show image shot with visual effect dissolve very slowly
end mouseUp


on mouseUp
put empty into fld "bool"
show image burger with visual effect dissolve very slowly
hide image shot with visual effect dissolve very slowly
put "true" into fld "bool"
answer "Are U Showing Yet?" with "Yes" or "No"
end mouseUp

in both cases the first effect runs and then the next one.. I don't get a "cross fade"  effect. in the latter, first the hidden image appears (behind the one in front) then the front one dissolves, then the fld is filled and then the answer dialog opens…

locking and unlocking the screen doesn't help

Are simultaneous visual effects + some process even possible? The dictionary does not explicitly declare visual effect to be blocking. But all my tests indicate it is.  I hope I am wrong.

BR









More information about the Use-livecode mailing list