Skip to main content

Card Component

The card component is a standard playing card that can receive input and animate from one position to another.

Animation

Card positions are cached automatically using the provided playerId and signature as a key. When a card is first rendered, it checks to see if it has a cached position. If it does, it animates from its cached position to the intended position.

Props

requirednametypedefaultdescription
anchorPointVector20.5, 0.5The AnchorPoint of the card's underlying frame.
yesdirectionCardDirectionThe CardDirection of the card.
onClicktypeThe function to be called when the card is clicked.
playerIdstringnilThe ID of the card's player.
positiontype0, 0, 0, 0The Position of the card's underlying frame.
rotationtype0The Rotation of the card's underlying frame.
selectedtypefalseWhether or not a bright selection border should appear around the card.
yessignaturestringThe signature of the card.
zIndextype1The ZIndex of the card's underlying frame.

onClick

The optional onClick prop is a callback function that runs when the player activates the card, either by clicking or tapping on it. The callback receives the underlying Roblox instance followed by the arguments provided by the Activated event.