Fade In and Out Using Blend Level: Performance Issues

Scott Rossi scott at tactilemedia.com
Tue Feb 2 00:26:47 EST 2016


Are you saying you can't use "dissolve"?  It works on iOS, but if you
can't use it on Android, you might have to use a less preferred transition.

In an attempt to keep things snappy in my own stacks, I usually set the
effectRate to 1000 along with dissolve very fast.  Most of the time, I
leave acceleratedRendering enabled, but sometimes it's worth trying
disabled.  When possible, it can help to limit the effect to a rect.

It probably won't make a difference but you can hide/show an object along
with a visual effect.

  hide img 1 with visual effect dissolve very fast

When doing a scripted dissolve with blendLevel, I prefer to sacrifice
smoothness for speed. I usually use 10 steps (10% increments) with a delay
of 0 to 5 millisecs.  I never go beyond 20 steps because the effect takes
too long to run.

On tablet size screens, you might be out of luck with a scripted dissolve.

If your image has a resizeQuality greater than "normal", you might try
setting it to normal before doing the fade.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 2/1/16, 8:37 PM, "use-livecode on behalf of Sannyasin Brahmanathaswami"
<use-livecode-bounces at lists.runrev.com on behalf of brahma at hindu.org>
wrote:

>I am trying to overcome the limitations we face with Mobile where our
>transitions are Limited to for example on IOS only flip there is no
>dissolve or anything like that.
>
>So I am using the blend level of the object or an image in setting this
>up or down to try and emulate fade in and fadeout effect but we are
>getting very poor performance. Works OK on desktop.
>
> it seems also have to have to do with the size of the object for example
>you can fade in and out. A small object did not see too much of a CPU hit
>but if you fade in and out an 1200 x 900 pixel Image then on the iPhone
>it can be very slow even if you have each repeat set to just a few
>millisecondsŠ it still takes several secondes to compelte.
>
> I am using the following handlers if anyone has any ideas about
>optimizing this I would be very interested. I think probably there's no
>way to do better and these repeat loops that are forcing the screen to
>update the entire pixel map are probably always going to perform very
>badly and I may need to just abandon this effect.
>
>
>command revealWithBlendLevel, pSpeed,pIterations
>
>   repeat pIterations times
>
>      set the blendlevel of  control gCurrentHiddenControl to pIterations
>
>      subtract 1 from pIterations
>
>      wait pSpeed milliseconds
>
>   end repeat
>
>end revealWithBlendLevel
>
>
>on fadeInObject pLevel
>
>      put 1 into tIncr
>
>   repeat pLevel times
>
>      set the blendlevel of image 1 to tIncr
>
>      add 1 to tIncr
>
>      wait 10 milliseconds
>
>   end repeat
>
>end fadeInObject
>
>
>command fadeOutCurrentControl pSpeed
>
>   put (the blendlevel of control gCurrentShowingControl) +1 into tLevel
>
>   set the blendlevel of control gCurrentShowingControl to tLevel
>
>   if tLevel < 100 then
>
>      send fadeOutCurrentControl to this stack in pSpeed ticks
>
>   else
>
>     lastRevealDone
>
>   end if
>
>end fadeOutCurrentControl
>
>
>BR
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the Use-livecode mailing list