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: 119
Joined: Mon Nov 03, 2014 12:17 am

Transparent Visual Effect

Post by JereMiami » Sun Dec 05, 2021 5:46 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Transparent Visual Effect

Post by richmond62 » Sun Dec 05, 2021 6:45 pm

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: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Transparent Visual Effect

Post by jmburnod » Sun Dec 05, 2021 6:47 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Transparent Visual Effect

Post by richmond62 » Sun Dec 05, 2021 7:03 pm

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 86 times

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Transparent Visual Effect

Post by JereMiami » Sun Dec 05, 2021 8:47 pm

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: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Transparent Visual Effect

Post by richmond62 » Sun Dec 05, 2021 8:51 pm

Can you post your stack, as I am unable to understand
exactly what you mean by 'involved'.

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Transparent Visual Effect

Post by JereMiami » Sun Dec 05, 2021 9:03 pm

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 96 times

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Transparent Visual Effect

Post by Klaus » Sun Dec 05, 2021 10:31 pm

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: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Transparent Visual Effect

Post by jiml » Mon Dec 13, 2021 10:44 pm

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: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Transparent Visual Effect

Post by jiml » Tue Dec 14, 2021 11:33 pm

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

Return to “Getting Started with LiveCode - Experienced Developers”