userInteractionEnabled property

bool userInteractionEnabled

The node will receive user interactions, such as pointer (touch or mouse) events.

class MyCustomNode extends NodeWithSize {
  userInteractionEnabled = true;
}

Implementation

bool get userInteractionEnabled => _userInteractionEnabled;
void userInteractionEnabled=(bool userInteractionEnabled)

Implementation

set userInteractionEnabled(bool userInteractionEnabled) {
  _userInteractionEnabled = userInteractionEnabled;
  if (_spriteBox != null) _spriteBox!._eventTargets = null;
}