One Logo Pool Ball
GameplayKit · IOS API REFERENCE

GKEntity

class · iOS 9.0+ · SDK 27.1

class GKEntity

Members (6)

method · iOS 9.0+

addComponent

TypeScript
addComponent(component: GKComponent): void
Swift declaration
func addComponent(_ component: GKComponent)
init · iOS 9.0+

init

TypeScript
static init(): GKEntity
Swift declaration
init()
method · iOS 9.0+

update

TypeScript
update(seconds: number): void
Swift declaration
func update(deltaTime seconds: TimeInterval)
get · iOS 9.0+

components

TypeScript
get components(): Array<GKComponent>
Swift declaration
var components: [GKComponent] { get }
method · iOS 9.0+

removeComponent

TypeScript
removeComponent(componentClass: string): void
Swift declaration
func removeComponent<ComponentType>(ofType componentClass: ComponentType.Type) where ComponentType : GKComponent

Removes the component of the indicates class from this entity - Parameter ofType: the type of component you want to remove

method · iOS 9.0+

component

TypeScript
component(componentClass: string): (GKComponent) | null
Swift declaration
func component<ComponentType>(ofType componentClass: ComponentType.Type) -> ComponentType? where ComponentType : GKComponent

Gets the component of the indicated class. Returns nil if entity does not have this component - Parameter ofType: the type of the component you want to get

Skipped declarations

No declarations were skipped in this snapshot.

All GameplayKit types →