Class Card

A game object representing a rectangular playing card. Can have arbitrary front and back images, dimensions (including thickness), and rounded corners. Specify dimensions using a rectangleCard or hexagonCard decorator on your custom class.

Hierarchy

Implements

Constructors

Properties

_lastActionIndex: number
back: CardFace = ...

Stores graphical information about the back face of the card.

children: DisplayContainer = ...

Contains child objects that are displayed on top of this card. This will also contain objects from display annotated properties, using the property keys as names.

cornerRadius: number

Corner radius of the card in centimeters.

cutout: boolean = false

If true, don't draw the sides of the card, and use alpha cutoff for the faces.

front: CardFace = ...

Stores graphical information about the front face of the card, as seen if the card isn't hidden.

height: number

Height of the card in centimeters.

hidden: CardFace = ...

Stores graphical information about the front face of the card, as seen if the card is hidden.

hiddenName?: string

Optional display name for this object when hidden.

name?: string

Optional display name for this object.

shape: CardShape

Shape of the card (rectangle, hexagon, ...).

svgUrl?: string

For cards using an SVG as a shape.

thickness: number

Thickness of the card in centimeters.

width: number

Width of the card in centimeters.

Accessors

  • get localBounds(): Bounds
  • How much space does this object take up.

    Returns Bounds

Methods

  • Builds a view of this object from the perspective of a player.

    Parameters

    • ctx: RenderContext

      Information about where the object is in the scene, and who's viewing it.

    Returns CardView

  • Get the dimensions of a card class, as specified by rectangleCard / hexagonCard decorator.

    Type Parameters

    Parameters

    • CardType: CardType<TCard>

      Type of card to get the dimensions of.

    Returns ICardDimensions

    Width, height, and thickness of the card in centimeters.

Generated using TypeDoc