Author |
Message |
Naveg
|
Posted: Sun Mar 27, 2005 11:22 am Post subject: solitaire help |
|
|
ok i need some help with solitaire. I'm using pictures to do all the cards, but i dont know how to allow the user to drag a card with the mouse. I know the basic Mouse commands, but the problem is with the constantly changing screen. In a loop i'd have to keep redrawing the screen minus that card, then draw the card on top. How would i do this? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 27, 2005 12:01 pm Post subject: (No subject) |
|
|
well how were you expecting to draw the screen when no cards are moving? |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 12:18 pm Post subject: (No subject) |
|
|
well normally when you'd move something you have like a set background, then you loop drawing the background and the piece on top. But here the background is always changing. If i take pic(0,0,maxx,maxy) then it includes the piece i'm about to move, but i want that piece to not be part of the background. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 27, 2005 12:20 pm Post subject: (No subject) |
|
|
tony wrote: well how were you expecting to draw the screen when no cards are moving? |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 12:26 pm Post subject: (No subject) |
|
|
the screen starts in an initial blank state, with the back of the deck and white boxes for where the card columns will be, the cards are placed by moving with the mouse |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 27, 2005 12:33 pm Post subject: (No subject) |
|
|
Great. Draw all of that minus the card to be moved |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 12:35 pm Post subject: (No subject) |
|
|
is there a way to do that taking pic(0,0,maxx,maxy)? cause otherwise i wouldnt know how to do it, cause as i said, whats on the screen is constantly changing. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 27, 2005 1:01 pm Post subject: (No subject) |
|
|
yes, just take a new picture every time you change something on the screen. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 3:39 pm Post subject: (No subject) |
|
|
then how do i capture everything except the selected card...my initial question |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 27, 2005 6:31 pm Post subject: (No subject) |
|
|
don't draw the selected card when doing the screen capture. |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 7:16 pm Post subject: (No subject) |
|
|
ok, that makes sense |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 7:17 pm Post subject: (No subject) |
|
|
another question, what would be the best way to keep track of the pictures in each column? have an array for each one?
also, is there a way to lift a picture off the screen without afftecting whats under it? |
|
|
|
|
![](images/spacer.gif) |
jamonathin
![](http://compsci.ca/v3/uploads/user_avatars/57683465145f851a43dd9a.gif)
|
Posted: Sun Mar 27, 2005 8:32 pm Post subject: (No subject) |
|
|
I would say have each colomn as a flexible array, and just assign a value to each card in that column, and when it's time to draw, it draws the appropriate amount, and the appropriate cards. |
|
|
|
|
![](images/spacer.gif) |
Naveg
|
Posted: Sun Mar 27, 2005 8:34 pm Post subject: (No subject) |
|
|
so like....
code: | var columns: array 1..7 of flexible array 1..1 of card |
where card has been declared as a type with values suit,value,and picture |
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
Posted: Sun Mar 27, 2005 8:46 pm Post subject: (No subject) |
|
|
No, that's not allowed!
Because Turing won't let you use a flexible array within a record, or a multidimensional array with the second dimension being flexible, I think this idea is pretty much dead. Well, you could just make 7 arrays yourself, but that's tedious. |
|
|
|
|
![](images/spacer.gif) |
|