Transparent Visual Effect

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JereMiami
Posts: 127
Joined: Mon Nov 03, 2014 12:17 am

Transparent Visual Effect

Post by JereMiami »

If I have a transparent image that I want to "show with visual effect," or "hide with visual effect," is there any way to write this, or set some sort of property, so that the visual effect just applies to the transparent image and does not grab the background objects showing behind it and cause them to get caught in the visual effect animation?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Transparent Visual Effect

Post by richmond62 »

Straight from the dictionary:

Code: Select all

on mouseUp
   lock screen for visual effect
   show img "FS" 
   unlock screen with visual effect "iris" close slow
end mouseUp
-
FSlags.jpg
-
Stack removed as updated version posted below.
Last edited by richmond62 on Sun Dec 05, 2021 7:03 pm, edited 1 time in total.
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Transparent Visual Effect

Post by jmburnod »

Hi,
You may use this for that:

Code: Select all

put the rect of Img "myImg" into tRect
lock screen for visual effect in rect tRect
Best regards
Jean-Marc
Last edited by jmburnod on Sun Dec 05, 2021 8:42 pm, edited 1 time in total.
https://alternatic.ch
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Transparent Visual Effect

Post by richmond62 »

does not grab the background objects showing behind it and cause them to get caught in the visual effect animation?
What am I missing?

Certainly, in this modified stack (i.e. put another image behind the one to be revealed)
this 'catching' does not seem to happen:
-
SShot 2021-12-05 at 20.01.03.png
Attachments
Viz.livecode.zip
Here's the stack
(83.42 KiB) Downloaded 247 times
JereMiami
Posts: 127
Joined: Mon Nov 03, 2014 12:17 am

Re: Transparent Visual Effect

Post by JereMiami »

Thanks! The image I have is a transparent image that is at a higher layer than the gold box (shown in the attachment). The transparent image covers the whole screen, including the gold box. I seem to be struggling to write this code so that only the image on layer 3 is involved in the visual effect animation so that layer 1 (the gold box) and layer 2 (the text field in the gold box) does not become part of the visual effect.

Any thoughts? Or should your code work and I'm just not doing it right?

Thanks again!
Attachments
visualeffect_transimg.jpg
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Transparent Visual Effect

Post by richmond62 »

Can you post your stack, as I am unable to understand
exactly what you mean by 'involved'.
JereMiami
Posts: 127
Joined: Mon Nov 03, 2014 12:17 am

Re: Transparent Visual Effect

Post by JereMiami »

Here it is. "Involved" means I don't want the object(s) under the transparent image to be "pushed," "revealed," or otherwise involved in the visual effect that is meant only to apply to the image that is overlaying them.
Attachments
img_effect.zip
(776 Bytes) Downloaded 273 times
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Transparent Visual Effect

Post by Klaus »

Hi JereMiami,

unfortunately I don't have an imge: C:/Users/jrj25/OneDrive/Desktop/1122121/images/transition1.png :D

Anyway, I think what you are after is only possible with the DISSOLVE effect, since all other effects work on
the RECT that needs to be updated on screen.

Instead of using the visual effect -> reveal down you could also move that image by script, that will do exactly
what you want. :-)

Best

Klaus
jiml
Posts: 341
Joined: Sat Dec 09, 2006 1:27 am

Re: Transparent Visual Effect

Post by jiml »

Hi JereMiami,

Perhaps instead of using a visual effect on that transparent image you might try animating its BLENDLEVEL.

Something like this in the script of theTransparentImage:

Code: Select all

on showMe
  repeat with x = 100 down to 0
    set the blend level of me to x
    wait 1 tick  --adjust speed here
  end repeat
end showMe

on hideMe
  repeat with x = 0 to 100
    set the blend level of me to x
    wait 1 tick  --adjust speed here
  end hideMe
end showMe
jiml
Posts: 341
Joined: Sat Dec 09, 2006 1:27 am

Re: Transparent Visual Effect

Post by jiml »

Make that:

Code: Select all

on showMe
  repeat with x = 100 down to 0
    set the blendlevel of me to x
    wait 1 tick  --adjust speed here
  end repeat
end showMe

on hideMe
  repeat with x = 0 to 100
    set the blendlevel of me to x
    wait 1 tick  --adjust speed here
  end repeat
end hideMe
Post Reply