The class Card

The class Card inherits from the class pygame.Sprite. It represents a card of a specific category.

class card.Card(center, width, height, color)

Class methods:

Attributes:

category

the category of the card

pos

the position of center of the card

width

the width of the rectangle (float)

height

the height of the rectangle (float)

Methods:

to_dict()

Returns a dict representing the rectangle

bounding_box()

Returns the bounding box of the rectangle (Box)

rasterization(tr)

Returns two int lists (rr, cc) made of the pixels’ coordinates of the rectangle’s rasterization with the given window-to -viewport transformations tr = (sx, sy, tx, ty)

The class supports the method str.