|
|
@
|
Sunday, February 24, 2002
|
|
| |
I want to release the Klondike game I wrote in REALbasic for a MacTech Programmer's Challenge. (I came in third!) I just need to fix things up a bit. I remember spending a lot of time getting the dragging right, but it never quite worked. The problem was that to really do dragging right you need to take a snapshot of the window behind the card being dragged so you can erase the card with what is behind it. But taking a snapshot of the entire window took too much memory for the Mac OS 9 version of the app. Mac OS X doesn't care about memory, so it isn't really a problem there. But in Mac OS 9 I would have needed to make the memory partition so huge to take the snapshot that I just didn't like it. The other way to accomplish the same thing would have been to take a much smaller snapshot of just that part of the window that I needed. But, if I remember correctly, the REALbasic API wasn't quite going to let me do that. So instead I did this complicated update of just the pixels that were being uncovered around the card during the drag. It worked. But it flashed around the edges of the card.
Now playing around with something that appears to do what I want. It requires that I do all my drawing in a canvas that sits on top of the window. What I do is make a Picture and draw the canvas into the picture at an origin that is shifted up and to the left. That way, only the part of the canvas I want is actually drawn into the Picture. The rest is clipped. Then I have a Picture that I can use to erase the card. I've managed to get this to work in a test case and now I just need to retrofit my Klondike game to use this new drawing and dragging procedure.
10:52:05 PM #
|
|
|
|
© Copyright
2002
Will Leshner.
Last update:
2/24/02; 10:52:29 PM.
|
|


|