Contents

EntityTabletop

A protocol for the table surface in your game when you render it using RealityKit.

Declaration

protocol EntityTabletop : Tabletop

Overview

To create a TableSetup object that configures your game table, pass an object that conforms to either the Tabletop or EntityTabletop protocol to the TableSetup initializer. If you render your table surface using RealityKit, conform to the EntityTabletop protocol. Implement your EntityTabletop structure to set the protocol properties, such as the shape, entity, and id properties.

struct Table: EntityTabletop {
    var shape: TabletopShape
    var entity: Entity
    var id: EquipmentIdentifier
    
    init() {
        self.entity = try! Entity.load(named: "table/table", in: contentBundle)
        self.shape = .round(entity: entity)
        self.id = .table
    }
}

Topics

Creating a round or rectangular table

Displaying the tabletop

Default Implementations

See Also

Essentials