Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
USingleClickTool is perhaps the simplest possible interactive tool. It simply reacts to default primary button clicks for the active device (eg left-mouse clicks).
The function IsHitByClick() determines what is clickable by this Tool. The default is to return true, which means the click will activate anywhere (the Tool itself has no notion of Actors, Components, etc). You can override this function to, for example, filter out clicks that don't hit a target object, etc.
The function OnClicked() implements the action that will occur when a click happens. You must override this to implement any kind of useful behavior.
| Name | USingleClickTool |
| Type | class |
| Header File | /Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseTools/SingleClickTool.h |
| Include Path | #include "BaseTools/SingleClickTool.h" |
Syntax
UCLASS (MinimalAPI)
class USingleClickTool :
public UInteractiveTool ,
public IClickBehaviorTarget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveTool → USingleClickTool
Implements Interfaces
Derived Classes
Functions
Public
Overridden from UInteractiveTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Setup() |
Register default primary-button-click InputBehaviors | BaseTools/SingleClickTool.h |
Overridden from IClickBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit IsHitByClick
(
const FInputDeviceRay& ClickPos |
Test if the Target is hit at this 2D position / 3D ray | BaseTools/SingleClickTool.h | |
virtual void OnClicked
(
const FInputDeviceRay& ClickPos |
Click the Target at this 2D position / 3D ray. Default behavior is to print debug string. | BaseTools/SingleClickTool.h |