Squeak Class Documentation category index | class index  
 
PlayingCard
  category: Morphic-Games
  superclass: Object
  subclasses:

This class assembles card images from their parts. The images are broken down so that the image data is very compact, and the code is written to display properly at all color depths. The method imageData may be removed after initialization to save space, but must be re-built prior to fileOut if you wish to retain the images.

To use in morphic, one can simply put these forms into ImageMorphs (see example in buildImage). However it should be possible to define a subclass of ImageMorph that simply creates playingCard instances on the fly whenever the image form is needed. This would avoid storing all the images.

instance methods
  all
  blankCard
buildImage
cardForm
color
copyTopToBottomHalf
faceColorMap
setCardNo:suitNo:cardForm:

class methods
  all
  imageData
includeInNewMorphMenu
initialize
test
the:of:

instance methods
  all top  
 

blankCard


 

buildImage

(PlayingCard the: 12 of: #hearts) cardForm display


 

cardForm


 

color


 

copyTopToBottomHalf

The bottom half is a 180-degree rotation of the top half (except for 7)


 

faceColorMap


 

setCardNo:suitNo:cardForm:


class methods
  all top  
 

imageData


 

includeInNewMorphMenu


 

initialize

PlayingCard initialize


 

test

Display all cards in the deck


 

the:of: