58 : _WidgetSlot(nullptr)
59 , _LayoutWidget(nullptr)
61 , _bSupportChildren(false)
63 , _RecenterOffset(ForceInitToZero)
64 , _bConsumeInput(false)
65 , _bRecenterOnTouch(false)
66 , _TopLeftPosition(ForceInitToZero)
67 , _InteractionSize(100.0f)
68 , _bRecenterHitBox(false)
73 SLATE_ARGUMENT(SConstraintCanvas::FSlot*, WidgetSlot)
74 SLATE_ARGUMENT(TSharedPtr<STouchInterface>, LayoutWidget)
75 SLATE_ARGUMENT(TSharedPtr<SLayoutComponent>, Parent)
76 SLATE_ARGUMENT(TArray<FDecorator>, Decorators)
77 SLATE_ARGUMENT(
bool, bSupportChildren)
78 SLATE_ARGUMENT(int32, InputPriority)
79 SLATE_ARGUMENT(FVector2D, RecenterOffset)
81 SLATE_ARGUMENT(
bool, bConsumeInput)
82 SLATE_ARGUMENT(
bool, bRecenterOnTouch)
83 SLATE_ARGUMENT(FVector4f, AnchorOffset)
84 SLATE_ARGUMENT(FVector2D, TopLeftPosition)
85 SLATE_ARGUMENT(FVector2D, Size)
86 SLATE_ARGUMENT(
float, InteractionSize)
87 SLATE_ARGUMENT(
bool, bRecenterHitBox)
88 SLATE_ARGUMENT(FName, ComponentName)
89 SLATE_ARGUMENT(
bool, bIsEditor)
98 void Construct(const FArguments& InArgs);
102 EActiveTimerReturnType PostGeometryInitialization(
double InCurrentTime,
float InDeltaTime);
105 void ConstructWidget() const;
112 TSharedPtr<STouchInterfaceRuntime> GetRuntimeTouchInterfaceWidget()
const;
117 void SetDecorators(TArray<FDecorator> NewDecorators);
118 void AddDecorator(TSharedPtr<SWidget> Decorator);
119 void InsertDecorator(TSharedPtr<SWidget> Decorator, int32 Index);
120 void RemoveDecorator(TSharedPtr<SWidget> DecoratorToRemove);
122 void ShowDecorator(TSharedPtr<SWidget> DecoratorWidget);
123 void HideDecorator(TSharedPtr<SWidget> DecoratorWidget);
129 virtual bool ProcessPressEvent(
const FGeometry& LayoutGeometry,
const FPointerEvent& PointerEvent);
130 virtual void ProcessMoveEvent(
const FGeometry& LayoutGeometry,
const FPointerEvent& PointerEvent);
131 virtual void ProcessReleaseEvent(
const FGeometry& LayoutGeometry,
const FPointerEvent& PointerEvent);
135 virtual void Tick(
const FGeometry& AllottedGeometry,
const double InCurrentTime,
const float InDeltaTime)
override;
136 virtual int32 OnPaint(
const FPaintArgs& Args,
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle,
bool bParentEnabled)
const override;
141 virtual void PaintDebug(
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle)
const;
145 virtual void UpdateScaleFactor(
const FGeometry& LayoutGeometry,
const float& ScaleFactor);
150 virtual FVector2D Recenter(
const FVector2D AbsoluteLocation);
152 virtual void ResetPosition();
160 void FullRebuildWidgetDecorator();
162 virtual void SetAnchor(
const FAnchors NewAnchors);
164 virtual void SetSize(
const FVector2D NewSize);
166 virtual void SetAnchorOffset(
const FVector4f Offset);
168 virtual void SetAlignment(
const FVector2D NewAlignment);
179 virtual void SetPositionFromTopLeft(
const FVector2D NewPosition);
183 void SetDebugType(
const int32 InDebugType) { DebugType = InDebugType; }
185 virtual bool IsUnderLocation(
const FVector2D AbsoluteLocation);
187 virtual bool CanInteract()
const;
191 virtual void BlockInput(
const bool bBlock) { bBlockInput = bBlock; }
194 FVector2D ScreenSpaceToLayoutSpace(
const FVector2D Location);
195 FVector2D LocalSpaceToNormalized(
const FVector2D Location)
const;
197 SConstraintCanvas::FSlot* CreateSlot(
const FAnchors Anchor,
const FVector2D Alignment);
198 void AddChild(TSharedPtr<SLayoutComponent> Component);
199 void AddChild(TSharedPtr<SLayoutComponent> Component,
const FAnchors Anchor,
const FVector2D Alignment);
200 void RemoveChild(TSharedPtr<SLayoutComponent> Component);
203 virtual void PaintOutline(
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle)
const;
205 virtual void Select() { bDrawSelectOutline =
true; }
206 virtual void Unselect() { bDrawSelectOutline =
false; }
208 virtual void Hover() { bDrawHoverOutline =
true; }
209 virtual void UnHover() { bDrawHoverOutline =
false; }
213 void SetSlotPosition(
const FVector2D& SlotPosition)
const;
214 void SetSlotSize(
const FVector2D SlotSize)
const;
217 FVector2D ComponentLocationToTopLeftLocation(
const FVector2D InComponentLocation)
const;
219 FVector2D TopLeftLocationToComponentLocation(
const FVector2D TopLeftLocation)
const;
248 TSharedPtr<SConstraintCanvas> CanvasWidget;
250 TSharedPtr<SRetainerWidget> RetainerWidget;
252 TSharedPtr<SOverlay> OverlayWidget;
254 TSharedPtr<SLayoutComponent> Parent;
256 TArray<TSharedPtr<SLayoutComponent>> Children;
258 TArray<FDecorator> Decorators;
260 TSharedPtr<STouchInterface> LayoutWidget;
262 SConstraintCanvas::FSlot* WidgetSlot;
264 TArray<int32> AffectedFingerIndex;
266 uint8 bForceRefresh:1;
279 bool bRecenterOnTouch;
280 bool bRecenterHitBox;
284 bool bIsEditorWidget;
286 FVector4f AnchorOffset;
288 FVector2D TopLeftPosition;
290 float InteractionSize;
294#if WITH_EDITORONLY_DATA
295 uint8 bDrawSelectOutline:1;
296 uint8 bDrawHoverOutline:1;