Skip to content

MPFEventHandler

MPFEventHandler is a Godot Node class provided by GMC that creates BCP event subscriptions to trigger behavior based on arbitrary MPF events.

Node Configuration

An MPFEventHandler can be placed anywhere in your scene, but must be either the direct parent or direct child of the nodes that will handle the event callback.

event_name:

Single value, type String

The name of the MPF event that this handler will subscribe to. If no BCP trigger is established for this event, one will be created on instantiation and removed when the node is destroyed.

handler_direction:

Single value, one of Parent or Children. Default Parent

Controls whether the MPFEventHandler triggers behavior on its parent node or on its children nodes.

If set to Parent, the call_method callable will be invoked on the direct parent of the MPFEventHandler node. If the parent does not have a callable by the specified name, a warning will be logged.

If set to Children, the call_method callable will be invoked on every direct child of the MPFEventHandler node. If a child does not have a callable by the specified name, it will be logged.

call_method:

Single value, type String

The name of a Callable (function) on the parent or child nodes that will be called when the event triggers. The event arguments will be passed to the callable as a dictionary.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results