Graphic manipulation

Shari shari at gypsyware.com
Fri Mar 11 18:17:55 EST 2005


This one had me buggered, and I still don't like the solution.  In my 
blackjack game there is a deck of cards, and as the cards are used up 
the deck gets smaller.

Originally the deck was a nice simple rectangle, and I had a button, 
a rectangle filled with a color, no name or border or anything.  As 
the deck "got smaller" the button "got bigger", adding 1 to the width 
of the button to have it cover the deck, making the deck appear 
smaller.

I've changed the graphics in the game and lordy I tried to get a deck 
graphic that was another nice easy rectangle, but I ended up with 
what is almost a rectangle rotated.

I finally fixed it for the deck to get smaller but lordy, I miss the 
easiness of the rectangle!

The final solution is not very pretty... I have a rectangular image 
of a deck, which is pretty hideous because when rotated, the image 
changes quite a bit.  To have the deck look like a deck I had to 
really create an ugly image to start with.  Then when rotated, it 
looks like it should.

As the cards are dealt, the image has to be updated.  I reimport the 
image, change the width, rotate it, and set the location.  Because 
you can't rotate an img a gazillion times and have it stay nice, 
every time the deck gets smaller (every few cards dealt) I reimport 
the image and change it.

Pretty nasty solution.  But it did work.

Because the image is an odd shape, and the rect of any image is 
square or rectangular, I couldn't just change the size of the image. 
I did try.

Then setting the loc of the cut card in an image of an odd shape, 
talk about a bugger!  Finally did it, but the code isn't pretty.

Ah well.


-- 
Mac and Windows shareware games
http://www.gypsyware.com


More information about the metacard mailing list