GameIrisScanner

class GameIrisScanner : GameSignalSender

A class that represents an iris scanner in the game.

Iris scanners are different from most inputs in that it works both by intervention and on a timer. When a player enters its radius, the input will activate for a specified period of time (default is 5 seconds).

  • Initialize an iris scanner.

    Declaration

    Swift

    init(at position: CGPoint)

    Parameters

    position

    The world matrix position of the iris scanner.

  • Required initializer for this class. Will result in a fatal error if you initialize the object this way.

    Declaration

    Swift

    required init?(coder aDecoder: NSCoder)
  • Whether the input should turn on/off based on player or object intervention.

    Declaration

    Swift

    override func shouldActivateOnIntervention(with player: Player?, objects: [SKSpriteNode?]) -> Bool

    Parameters

    player

    The player to listen to for intervention.

    objects

    The objects to listen to for intervention.

    Return Value

    Whether the input should activate given the intervention criteria.

  • Run any post-activation methods.

    Declaration

    Swift

    override func onActivate(with event: NSEvent?, player: Player?)

    Parameters

    event

    The event handler that triggered the activation.

    player

    The player that triggered the activation.

  • Run any post-deactivation methods.

    Declaration

    Swift

    override func onDeactivate(with event: NSEvent?, player: Player?)

    Parameters

    event

    The event handler that triggered the activation.

    player

    The player that triggered the activation.