Touch Interface Listener is the base class that works with the STouchInterface class, the widget created by Touch Interface Designer to display your touch interface. A listener can be registered with a touch interface to receive inputs. It incorporates various functions, such as prioritization in relation to other listeners or a standalone mode.
Touch Interface Designer integrates two listeners:
Touch Interface Listener Component Settings #
Input
This component integrates a priority system similar to that of inputs. So you can define the order in which your components will get the inputs relative to the others. You can also specify if a component blocks inputs on other components with a lower priority.
- Priority : Select priority for this component. The higher the priority, the more the component has a chance of obtaining the inputs first compared to the other components.
- Block Lower Priority : Allows the component to block inputs to other components that have a lower priority. The other components that have the same priority value will still receive the inputs
Registration
This component must be registered with the touch interface in order to receive inputs. You can do this in two different ways: Either check the Register on Start parameter, the component will try to register automatically with the touch interface at begin play. Either use the Touch Interface Subsystem to manually register the component with the touch interface.
Note: If the touch interface has not yet been added to the screen or changes during game operation, all listener components will be automatically registered to any touch interface that is created.
- Register on Start : If true, the component try to register on begin play but it can fail. In this case, the OnRegisterFail event is called. You will have to register the component manually.
- Auto Receive Input : Automatically registers this actor to receive input from a player.
Create my own #
Simply create a class that inherit from Touch Interface Listener and override the available function like OnTouchBegin, OnTouchMove or OnTouchEnd.