Flipping solitaire cards with core images

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
paulgabel
Posts: 31
Joined: Tue Jun 19, 2007 7:03 pm
Location: Scotts Valley, California, USA
Contact:

Flipping solitaire cards with core images

Post by paulgabel » Fri Feb 01, 2013 11:36 pm

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
Paul Gabel

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Flipping solitaire cards with core images

Post by bn » Sat Feb 02, 2013 2:10 pm

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 454 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

paulgabel
Posts: 31
Joined: Tue Jun 19, 2007 7:03 pm
Location: Scotts Valley, California, USA
Contact:

Re: Flipping solitaire cards with core images

Post by paulgabel » Sat Feb 02, 2013 6:01 pm

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
Paul Gabel

Post Reply

Return to “Games”