Non-rectangular visual effects

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 146
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Non-rectangular visual effects

Post by strongbow » Thu Oct 04, 2012 12:37 pm

Has anyone tried/succeeded to get a non-rectangular visual effect on a part of the screen?

Or has anyone got some good ideas for using a flip visual effect using a circle, for example?

In a very controlled environment, eg. with a black background and a circular image in front, it would seem to be possible to get the appearance of it working, but if there's a background image around the target circle, then I think it may be very difficult, since the docs say, for a flip effect:

"The background behind the flip is taken from the background color of the current stack - i.e. the card is cut out and flipped over the stack."

So an image on the card surrounding the target could not possibly have the same background color as the stack, thus making this impossible. Or?

Any ideas?

Thanks!

Alan :-)

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: Non-rectangular visual effects

Post by scotttyang » Thu Oct 04, 2012 5:43 pm

can't use the flip visual effect unless the background is black.

The only workaround i thought of was something like...shrink the width, flip the image then expand the image back to original width....something like below...

repeat with x=1 to 10
set the width of image "flipimage" to the formattedwidth of image "flipimage" * (1 - (.1*x)
end repeat

flip image "flipimage"

repeat with x=1 to 10
set the width of image "flipimage" to the formattedwidth of image "flipimage" * (.1*x)
end repeat

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 146
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Re: Non-rectangular visual effects

Post by strongbow » Thu Oct 04, 2012 9:26 pm

Hi Scott

Thanks loads for the hint!! Great. Needs (as far as I can tell) a couple of small additions, finished script below... Again, thanks a lot for the help, really appreciate it!

Code: Select all

on flipLeft pTarget
   put the loc of pTarget into tLoc
   
   repeat with x=1 to 10
      set the width of pTarget to the formattedwidth of pTarget * (1 - (.1*x))
      set the loc of pTarget to tLoc
      wait 0 secs
   end repeat
   
   //flip image "flipimage"
   set the filename of pTarget to [the flipped image name here]
   
   repeat with x=1 to 10
      set the width of pTarget to the formattedwidth of pTarget * (.1*x)
      set the loc of pTarget to tLoc
      wait 0 secs
   end repeat
end flipLeft
cheers,

Alan :-)

Post Reply