NAP
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
PointerInputComponentInstance Class Reference

#include <inputcomponent.h>

Public Member Functions

 PointerInputComponentInstance (EntityInstance &entity, Component &resource)
 
- Public Member Functions inherited from InputComponentInstance
 InputComponentInstance (EntityInstance &entity, Component &resource)
 
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
 
virtual void update (double deltaTime)
 
nap::EntityInstancegetEntityInstance () const
 
nap::ComponentgetComponent () const
 
template<typename T >
T * getComponent () const
 
virtual bool init (utility::ErrorState &errorState)
 
virtual bool init (utility::ErrorState &errorState)
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

Signal< const PointerPressEvent & > pressed
 Signal emitted when the input component receives a click. More...
 
Signal< const PointerReleaseEvent & > released
 Signal emitted when the click is released. More...
 
Signal< const PointerMoveEvent & > moved
 Signal emitted when this component receives a mouse move. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Protected Member Functions

virtual void trigger (const nap::InputEvent &inEvent) override
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Input component that receives mouse events Register to the various signals to receive mouse events

Inheritance diagram for PointerInputComponentInstance:
[legend]
Collaboration diagram for PointerInputComponentInstance:
[legend]

Constructor & Destructor Documentation

◆ PointerInputComponentInstance()

PointerInputComponentInstance ( EntityInstance entity,
Component resource 
)

Member Function Documentation

◆ trigger()

virtual void trigger ( const nap::InputEvent inEvent)
overrideprotectedvirtual

This function is called by an InputRouter derived class if it decides to route the input to this component. Implement this function in a derived class to handle input.

Parameters
inEventAn InputEvent-derived class. Use RTTI queries to test the type of event and to retrieve data from it.

Implements InputComponentInstance.

Member Data Documentation

◆ moved

Signal<const PointerMoveEvent&> moved

Signal emitted when this component receives a mouse move.

◆ pressed

Signal<const PointerPressEvent&> pressed

Signal emitted when the input component receives a click.

◆ released

Signal<const PointerReleaseEvent&> released

Signal emitted when the click is released.