Page 1 of 1

Flipping solitaire cards with core images

Posted: Fri Feb 01, 2013 11:36 pm
by paulgabel
Hi:

I am trying to flip cards in my solitaire game using core images.

Code: Select all

on mouseUp
    lock screen
    put image "card2" into image "card1"
    unlock screen with visual effect CIPageCurlTransition slow with angle 0.3 and backsideImage id 15444 and extent (0,0,400,300) and radius 200.00 and shadingImage id 15449
end mouseUp
Card1 is the card back and card2 is the same card face up.

The problem is that if I use lock screen/unlock screen, as in the example above, it shows card2 and then curls it. If I don't use lock screen/unlock screen, as follows ...

Code: Select all

show image "card1" with visual effect CIPageCurlTransition slow with angle 0.3 and backsideImage id 15444 and extent (0,0,400,300) and radius 200.00 and shadingImage id 15449
... I have the same problem. How can I make the card as a card back curl up to reveal the same card face up? Thank you very much for any suggestions.

Paul Gabel

Re: Flipping solitaire cards with core images

Posted: Sat Feb 02, 2013 2:10 pm
by bn
Hi Paul,

Code: Select all

 put image "card2" into image "card1"
this replaces image "card1" with image "card2". I don't think it is what you want.

first hide image "card1", at the location of image "card1" is image "card2".
then issue your show image... command.

I append a little stack that shows it.
visualEffects.livecode.zip
(123.9 KiB) Downloaded 530 times
You probably have seen the example stack "Core Image Visual effects" that comes with Livecode.

for more visual effects see also a stack I made
http://revonline2.runrev.com/stack/461/ ... ransitions

Kind regards
Bernd

Re: Flipping solitaire cards with core images

Posted: Sat Feb 02, 2013 6:01 pm
by paulgabel
bn wrote:Hi Paul,

Code: Select all

 put image "card2" into image "card1"
this replaces image "card1" with image "card2". I don't think it is what you want.

first hide image "card1", at the location of image "card1" is image "card2".
then issue your show image... command.

I append a little stack that shows it.
visualEffects.livecode.zip
You probably have seen the example stack "Core Image Visual effects" that comes with Livecode.

for more visual effects see also a stack I made
http://revonline2.runrev.com/stack/461/ ... ransitions


Thanks Bernd. I'll try all of your suggestions. Paul

Kind regards
Bernd