Touch Interface Designer 2025.2
Create touch interface with a visual editor and manage all mobile inputs like gestures
Loading...
Searching...
No Matches
LayoutComponent.h
Go to the documentation of this file.
1 // Copyright 2024 Lost in Game Studio. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/Object.h"
7#include "Widgets/Layout/SConstraintCanvas.h"
8#include "LayoutComponent.generated.h"
9
13class UComponentLogic;
15class URadialProgressBarLayer;
16class UTextLayer;
17class UBlurLayer;
18class UFlipbookLayer;
19class UWidgetLayer;
21class STouchInterface;
23class UTextureRenderTarget2D;
24class ULocalPlayer;
25
26#if WITH_EDITOR
27DECLARE_MULTICAST_DELEGATE(FOnObjectChanged)
28#endif
29
30UENUM(BlueprintType)
31enum class EInteractionType : uint8
32{
36
40
46};
47
48USTRUCT(BlueprintType)
49struct FHitBox
50{
51 GENERATED_BODY()
52
53 UPROPERTY(Category="Hit Box", EditAnywhere, BlueprintReadWrite)
55
56 UPROPERTY(Category="Hit Box", EditAnywhere, BlueprintReadWrite)
57 FVector2D Position;
58
59 UPROPERTY(Category="Hit Box", EditAnywhere, BlueprintReadWrite)
60 FVector2D Size;
61
64 , Position(ForceInitToZero)
65 , Size(ForceInitToZero)
66 {
67
68 }
69};
70
71UENUM(BlueprintType)
88
89//TODO: Add in options settings the class used for layout component (should derive from layout component)
90
92UCLASS(BlueprintType)
93class TOUCHINTERFACE_API ULayoutComponent : public UObject
94{
95 GENERATED_BODY()
96
97public:
99
100 virtual void BeginDestroy() override;
101
102 //TODO: Make Create Widget Instance function like in Component Decorator class
103 virtual TSharedRef<SLayoutComponent> TakeWidget(SConstraintCanvas::FSlot* WidgetSlot, TSharedPtr<STouchInterface> LayoutWidget, ULocalPlayer* LocalPlayer, TSharedPtr<SLayoutComponent> InParent = nullptr);
104
105 UTextureRenderTarget2D* GetCollapsedLayer();
106
107 //FName GenerateUniqueName();
108
109 FVector2D GetComponentOffset() const { return LayoutModifierOffset; }
110
111 void SetComponentOffset(const FVector2D InCenterOffset) { LayoutModifierOffset = InCenterOffset; }
112
113 virtual void UpdateScaleFactor(const FGeometry& LayoutGeometry, const float& ScaleFactor);
114
115 void SetPortraitMode(const bool bEnable);
116
117 bool IsInPortraitMode() const { return bPortraitMode; }
118
120
122
123 virtual TSharedPtr<SLayoutComponent> GetWidgetInstance() const { return ComponentWidget; }
124
125 TSharedPtr<STouchInterface> GetTouchInterfaceWidget() const { return TouchInterfaceWidget; }
126
127 void SetAnchor(const FAnchors NewAnchor);
128
129 void SetTopLeftLocation(const FVector2D Value);
130
131 void SetSize(const FVector2D Value);
132
133 FVector2D GetParentSize() const;
134
135#if WITH_EDITOR
136 virtual void OnBeginEditByEditor();
137
138 virtual void OnDesignerSizeChanged(const FIntPoint NewSize);
139
140 virtual void OnCleanedByEditor();
141
142 virtual void OnEndEditByEditor();
143
144 //TODO: Remove this function and add bool bIsEditor in TakeWidget function
145 virtual TSharedRef<SLayoutComponent> TakeEditorWidget(SConstraintCanvas::FSlot* WidgetSlot, TSharedPtr<STouchInterface> LayoutWidget, TSharedPtr<SLayoutComponent> InParent = nullptr);
146
147 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
148
149 virtual void NotifyOnPropertyChanged();
150
151 FBox2D GetBox2D(FVector2D GeometrySize) const;
152
153 void RebuildDecorator();
154#endif
155
156public:
157 UFUNCTION(Category="Layout Component", BlueprintCallable)
158 FAnchors GetAnchor() const { return Anchors; }
159
160 UFUNCTION(Category="Layout Component", BlueprintCallable)
161 FVector2D GetAlignment() const { return Alignment; }
162
163 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
164 FVector4f GetAnchorOffset() const { return AnchorOffset; }
165
169 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
170 virtual FVector2D GetComponentLocation() const;
171
174 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
175 virtual FVector2D GetComponentTopLeftLocation();
176
177 //TODO: Get component center location
178
179 //TODO: Get component aligned location. Alignment offset
180
183 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
184 virtual FVector2D GetComponentLocalLocation() const;
185
188 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
189 virtual FVector2D GetLayoutTopLeftLocation() const;
190
193 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
194 virtual FVector2D GetLayoutTopLeftCenterLocation() const;
195
198 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
199 virtual FVector2D GetLayoutTopLeftLocationAtAlignment(FVector2D AtAlignment);
200
201
202 UFUNCTION(Category="Layout Component|Position", BlueprintCallable, BlueprintPure)
203 float GetComponentAngle() const { return Angle; }
204
205
206 UFUNCTION(Category="Layout Component|Size", BlueprintCallable, BlueprintPure)
207 FVector2D GetComponentSize() const;
208
209 // Return max offset for this component position in layout modifier
210 UFUNCTION(Category="Layout Component|Modifier", BlueprintCallable, BlueprintPure)
211 virtual FVector4f GetComponentMaxOffset() const { return MaxCenterOffset; }
212
213 // Return min (X) and max (Y) size scale for this component in layout modifier
214 UFUNCTION(Category="Layout Component|Modifier", BlueprintCallable, BlueprintPure)
215 FVector2D GetComponentSizeScale() const { return MaxSizeScale; }
216
217
218 //SETTERS
219
220 UFUNCTION(Category="Layout Component", BlueprintCallable)
221 virtual void SetComponentAnchorPreset(const EAnchorPosition Anchor);
222
223 //UFUNCTION(Category="Layout", BlueprintCallable)
224 //virtual void SetComponentCustomAnchors(const FAnchors InAnchors);
225
226 UFUNCTION(Category="Layout Component", BlueprintCallable)
227 virtual void SetComponentAlignment(const FVector2D NewAlignment);
228
229 UFUNCTION(Category="Layout Component", BlueprintCallable)
230 virtual void SetAnchorOffset(const FVector4f NewAnchorOffset);
231
234 UFUNCTION(Category="Layout Component|Position", BlueprintCallable)
235 virtual void SetComponentLocation(const FVector2D NewLocation);
236
237 // Set component location in local space (component space if there is a parent, layout space otherwise).
238 UFUNCTION(Category="Layout Component|Position", BlueprintCallable)
239 virtual void SetComponentLocalLocation(const FVector2D NewLocation);
240
241 // Set component offset for portrait mode in layout space.
242 UFUNCTION(Category="Layout Component|Position", BlueprintCallable)
243 virtual void SetComponentPortraitOffset(const FVector2D NewOffset);
244
245 //TODO: Add component offset, local offset
246
247 // Set component angle in degree.
248 UFUNCTION(Category="Layout Component|Position", BlueprintCallable)
249 virtual void SetComponentAngle(const float Value);
250
251
252 UFUNCTION(Category="Layout Component|Size", BlueprintCallable)
253 virtual void SetComponentSize(const FVector2D NewSize);
254
255 //TODO: SetComponentLocationAndSize
256
257 //TODO: Remove this function, it's useless
258 UFUNCTION(Category="Layout Component|Modifier", BlueprintCallable)
259 virtual void SetComponentSizeScale(const FVector2D NewSizeScale);
260
261
262 //UTILITIES
263
264 UFUNCTION(Category="Layout Component", BlueprintCallable, BlueprintPure)
265 virtual bool IsUnderLocation(const FVector2D AbsoluteLocation);
266
267 UFUNCTION(Category="Layout Component", BlueprintCallable, BlueprintPure)
268 virtual bool CanInteract() const;
269
270 UFUNCTION(Category="Layout Component", BlueprintCallable)
271 virtual bool IsPressed() const;
272
273 UFUNCTION(Category="Layout Component|Visibility", BlueprintCallable)
274 virtual void SetComponentVisibility(const bool bVisible);
275
276 UFUNCTION(Category="Layout Component|Visibility", BlueprintCallable)
277 virtual bool IsVisible();
278
279 UFUNCTION(Category="Layout Component", BlueprintCallable)
280 virtual void Recenter(const FVector2D LayoutPosition = FVector2D::ZeroVector);
281
282 UFUNCTION(Category="Layout Component", BlueprintCallable)
283 virtual void ResetPosition();
284
285 UFUNCTION(Category="Layout Component", BlueprintCallable)
286 virtual const FGeometry& GetComponentGeometry();
287
288 // Return true if this component is inside group
289 UFUNCTION(Category="Layout Component", BlueprintCallable, BlueprintPure)
290 virtual bool IsChild() const;
291
295 UFUNCTION(Category="Layout Component", BlueprintCallable, BlueprintPure)
296 ULayoutComponent* GetParent() const;
297
298 UFUNCTION(Category="Layout Component", BlueprintCallable, BlueprintPure)
299 UTouchInterfaceLayout* GetTouchInterfaceLayout() const;
300
304 UFUNCTION(Category="Layout Component", BlueprintCallable)
305 virtual void RebuildDecorators() const;
306
307
308 //ADD-FIND-REMOVE DECORATOR
309
310 // Add new decorator. Return instance of created decorator.
311 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
312 UComponentDecorator* AddDecoratorByClass(TSubclassOf<UComponentDecorator> DecoratorClass, const FName Name);
313
314 // Add new decorator.
315 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
316 void AddDecorator(UComponentDecorator* Decorator);
317
322 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
323 UComponentDecorator* InsertDecoratorByClassAt(TSubclassOf<UComponentDecorator> DecoratorClass, FName Name, int32 Index);
324
328 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
329 void InsertDecoratorAt(UComponentDecorator* Decorator, int32 Index);
330
331 // Remove decorator by name.
332 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
333 void RemoveDecoratorByName(const FName Name);
334
335 // Remove decorator by index.
336 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
337 void RemoveDecoratorAt(const int32 Index);
338
339 // Get index of decorator by name.
340 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
341 int32 GetDecoratorIndex(const FName Name);
342
343 // Returns the first instance of decorator type.
344 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, meta=(DeterminesOutputType = "Class"))
345 UComponentDecorator* GetDecoratorByClass(TSubclassOf<UComponentDecorator> Class);
346
347 // Returns decorator instance by name.
348 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
349 UComponentDecorator* GetDecoratorByName(const FName Name, bool bRecursive);
350
351 // Returns decorator instance by index.
352 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
353 UComponentDecorator* GetDecoratorByIndex(const int32 Index);
354
355 // Returns all decorator of type.
356 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, meta=(DeterminesOutputType = "Class"))
357 TArray<UComponentDecorator*> GetAllDecoratorsOfClass(TSubclassOf<UComponentDecorator> Class);
358
359 // Returns all decorators.
360 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
361 TArray<UComponentDecorator*> GetAllDecorators(bool bRecursive);
362
363 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
364 TArray<FName> GetAllDecoratorNames(bool bRecursive);
365
368 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
369 UProgressBarLayer* GetDecoratorAsProgressBar(const FName LayerName);
370
373 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
374 UTextLayer* GetDecoratorAsText(const FName LayerName);
375
378 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
379 UBlurLayer* GetDecoratorAsBlur(const FName LayerName);
380
383 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
384 UFlipbookLayer* GetDecoratorAsFlipbook(const FName LayerName);
385
388 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
389 UComponentDecoratorGroup* GetDecoratorAsGroup(const FName LayerName);
390
393 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
394 UWidgetLayer* GetDecoratorAsWidget(const FName LayerName);
395
399 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
400 bool ContainDecoratorName(const FName Name, bool bRecursive = false);
401
402 // Returns true if contain decorator instance.
403 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
404 bool ContainDecorator(UObject* LayerObject);
405
406 // Returns true if contain decorator of class.
407 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable, BlueprintPure)
408 bool ContainDecoratorClass(TSubclassOf<UComponentDecorator> Class);
409
410 // Get opacity value of decorator (global, each decorator can have different opacity).
411 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
412 float GetOpacity() const { return Opacity; }
413
414 // Set opacity value of decorator.
415 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
416 void SetOpacity(const float Value) { Opacity = Value; }
417
419 bool HitPixel(const FVector2D NormalizedPosition, const float AlphaTolerance = 0);
420
421 //MODIFYING DECORATOR
422
427 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
428 void BeginEditDecorator(const FName LayerName);
429
430 // Apply decorator modifications on next tick.
431 UFUNCTION(Category="Layout Component|Appearance", BlueprintCallable)
432 void EndEditDecorator();
433
434 //TODO: GetDynamicMat
435
436 bool ConsumeInput() const { return bConsumeInput; }
437 bool CanRecenter() const { return bRecenterOnTouch; }
438
439 FVector2D GetOffsetFromCenter() const { return OffsetFromCenter; }
440
442
443 //Get the interaction size of component.
444 UFUNCTION(Category="Layout Component|Input", BlueprintCallable, BlueprintPure)
445 float GetInteractionSize() const { return InteractionSize; }
446
447 //Get the priority of this component.
448 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
449 int32 GetInputPriority() const { return Priority; }
450
451 //Return true if this component consume input.
452 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
453 bool IsConsumeInput() const { return bConsumeInput; }
454
455 //TODO: Return ULayoutComponent instead of UGroupInputComponent
458 UFUNCTION(Category="Layout Component|Input", BlueprintCallable, BlueprintPure)
459 ULayoutGroupComponent* GetGroup();
460
461
462 //Set the interaction size of this component.
463 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
464 void SetInteractionSize(const float Value);
465
466 //Set the input priority of this component.
467 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
468 void SetInputPriority(const int32 NewPriority);
469
472 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
473 void SetConsumeInput(const bool Value) { bConsumeInput = Value; }
474
475 //Enable input. This component will now receive input.
476 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
477 void EnableInput();
478
479 //Disable input (no interaction).
480 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
481 void DisableInput();
482
483 //Return true if input is enabled.
484 UFUNCTION(Category="Layout Component|Input", BlueprintCallable, BlueprintPure)
485 bool IsInputEnabled();
486
487 //Set the new logic class used by this component.
488 UFUNCTION(Category="Layout Component|Input", BlueprintCallable)
489 UComponentLogic* SetLogic(const TSubclassOf<UComponentLogic> NewLogicClass);
490
491
492//PROPERTIES
493public:
494
495#if WITH_EDITOR
496 FOnObjectChanged OnObjectChanged;
497
498 friend class STouchInterfaceLayoutEditor;
499 friend class FTouchInterfaceLayoutEditor;
500 friend class SWidgetHandle;
501 friend class SAnchorHandle;
502 friend class FTouchInterfaceDesignerEditorMenuExtender;
503#endif
504
505 //TODO: In near future, remove anchor preset and make custom detail panel with small widget (like umg but always displayed) for quick preset
506 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess="true"))
507 EAnchorPosition AnchorPreset;
508
509 //Anchors of component
510 //UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess="true"), meta=(EditCondition="AnchorPreset==EAnchorPosition::Custom"))
511 //FAnchors Anchors;
512
513 //TODO: Remove Location and use only AnchorOffset with custom detail panel (Rename anchor offset labels)
516 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(EditCondition="AnchorPreset!=EAnchorPosition::HalfLeft && AnchorPreset!=EAnchorPosition::HalfRight && AnchorPreset!=EAnchorPosition::Fill", EditConditionHides))
517 FVector2D Location;
518
519 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(EditCondition="AnchorPreset==EAnchorPosition::HalfLeft || AnchorPreset==EAnchorPosition::HalfRight || AnchorPreset==EAnchorPosition::Fill", EditConditionHides))
520 FVector4f AnchorOffset;
521
524 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(EditCondition="AnchorPreset!=EAnchorPosition::HalfLeft && AnchorPreset!=EAnchorPosition::HalfRight && AnchorPreset!=EAnchorPosition::Fill", EditConditionHides))
525 FVector2D Size;
526
527 // Pivot location inside component geometry.
528 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess="true"), meta=(EditCondition="AnchorPreset!=EAnchorPosition::HalfLeft && AnchorPreset!=EAnchorPosition::HalfRight && AnchorPreset!=EAnchorPosition::Fill", EditConditionHides))
529 FVector2D Alignment;
530
533 UPROPERTY()
534 FVector2D DesignLocation;
535
539 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly)
540 FVector2D PortraitOffset;
541
542 // Angle of component.
543 UPROPERTY(Category="Layout", EditAnywhere, BlueprintReadOnly, meta=(ClampMin=-180.0f, ClampMax=180.0f))
544 float Angle;
545
546
549 UPROPERTY()
550 FVector2D DesignSize;
551
552 // Array of decorator that compose the layout component.
553 //UPROPERTY()
554 //TArray<UComponentDecorator*> Decorators;
555
556 UPROPERTY()
557 TArray<TObjectPtr<UComponentDecorator>> Decorators;
558
559
560 // Global Opacity of decorator.
561 UPROPERTY(Category="Appearance", EditAnywhere, BlueprintReadOnly, meta=(ClampMin=0.0f, ClampMax=1.0f))
562 float Opacity;
563
564 // If false, this component appear hidden at startup.
565 UPROPERTY(Category="Appearance", EditAnywhere, BlueprintReadOnly)
566 uint8 bIsVisible:1;
567
568
572 UPROPERTY(Category="Optimization", EditAnywhere, BlueprintReadOnly)
574
575
576 // Enable or disable component location modification in the layout modifier widget.
577 UPROPERTY(Category="Modifier", EditAnywhere, BlueprintReadOnly)
579
582 UPROPERTY(Category="Modifier", EditAnywhere, BlueprintReadOnly)
584
585 UPROPERTY(Category="Modifier", EditAnywhere, BlueprintReadOnly)
587
590 UPROPERTY(Category="Modifier", EditAnywhere, BlueprintReadOnly)
591 FVector2D MaxSizeScale;
592
593
596 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly)
598
600 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadWrite)
602
610 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly, meta=(ClampMin=0, ForceUnits="%"))
611 float InteractionSize;
612
613 /* If enabled, hit box is moved when component is re-centered.
614 * Base hit box keep its position and a child hit box is created with center at current touch position.
615 * Its center position cannot exceed the max size of base hit box. */
616 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly, meta=(EditCondition="bRecenterOnTouch"))
617 bool bRecenterHitBox;
618
619 //TODO: Offset for interaction shape?
620
625 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly)
627
630 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly, meta=(EditCondition="bConsumeInput==true"))
631 int32 Priority;
632
633 // Enable if you want to receive tick event in logic. Disable if not needed (save performance).
634 //UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly)
635 //uint8 bShouldTick:1;
636
637 UPROPERTY(Category="Input", EditAnywhere, BlueprintReadOnly, Instanced)
638 TObjectPtr<UComponentLogic> Logic;
639
640 //TODO: Make animation system for layout component
641 //UPROPERTY(Category="Layer", EditAnywhere, BlueprintReadOnly, Instanced)
642 //TArray<TObjectPtr<class ULCDecorator_Animation>> Animations;
643
644
645protected:
646 UPROPERTY()
648
649 UPROPERTY()
651
652 //TODO: Use this instead of function in child class
654
656
657 //Logic that is duplicated at runtime for edit
658 UPROPERTY()
659 TObjectPtr<UComponentLogic> LogicCompInstance;
660
661 //UPROPERTY()
662 //TObjectPtr<ULayoutComponent> Parent;
663
664 //TODO: Can we use UObject for parent and then determine, when needed, if UObject is LayoutComponent or TouchInterfaceLayout?
665 //TODO: TouchInterfaceLayout should reference touch interface widget for better interaction
666 //UPROPERTY()
667 //TObjectPtr<UObject> Parent;
668
670
671 //TODO: Remove this, compute top left location only when needed (mainly in editor)
672 UPROPERTY()
674
675private:
676 UPROPERTY()
677 TWeakObjectPtr<UComponentDecorator> DecoratorEdited;
678
679 UPROPERTY()
680 FVector2D ComponentSize;
681
682 UPROPERTY()
683 FAnchors Anchors;
684
685 float CachedScaleFactor;
686
687 uint8 bPortraitMode:1;
688
689 uint8 bBlockInput:1;
690
691#if WITH_EDITOR
692 FVector2D DesignerSize;
693#endif
694
695 //TODO: Layout Location (location in touch interface geometry space), Local Location (location in layout component space or anchor space), Relative Location (relative location in touch interface geometry,
696};
BlueprintType
Definition ComponentDecorator_Animation.h:40
EInteractionType
Definition LayoutComponent.h:32
@ Circle
Definition LayoutComponent.h:39
@ Alpha
Definition LayoutComponent.h:45
@ Square
Definition LayoutComponent.h:35
EAnchorPosition
Definition LayoutComponent.h:73
@ HalfRight
Definition LayoutComponent.h:84
@ TopRight
Definition LayoutComponent.h:76
@ Center
Definition LayoutComponent.h:78
@ HalfLeft
Definition LayoutComponent.h:83
@ TopMiddle
Definition LayoutComponent.h:75
@ BottomRight
Definition LayoutComponent.h:82
@ BottomLeft
Definition LayoutComponent.h:80
@ CenterLeft
Definition LayoutComponent.h:77
@ CenterRight
Definition LayoutComponent.h:79
@ TopLeft
Definition LayoutComponent.h:74
@ BottomMiddle
Definition LayoutComponent.h:81
@ Fill
Definition LayoutComponent.h:85
Definition SLayoutComponent.h:55
Definition STouchInterface.h:43
Definition BlurLayer.h:12
Definition ComponentDecoratorGroup.h:14
Definition ComponentDecorator.h:36
Definition FlipbookLayer.h:15
Definition LayoutComponent.h:94
BlueprintReadOnly
Definition LayoutComponent.h:506
BlueprintPure UTextLayer * GetDecoratorAsText(const FName LayerName)
Definition LayoutComponent.cpp:1439
BlueprintReadOnly FVector2D PortraitOffset
Definition LayoutComponent.h:540
meta
Definition LayoutComponent.h:344
FVector2D OffsetFromCenter
Definition LayoutComponent.h:669
FVector2D GetComponentOffset() const
Definition LayoutComponent.h:109
bool IsInPortraitMode() const
Definition LayoutComponent.h:117
float CurrentSizeScale
Definition LayoutComponent.h:650
BlueprintCallable
Definition LayoutComponent.h:163
virtual TSharedRef< SLayoutComponent > TakeWidget(SConstraintCanvas::FSlot *WidgetSlot, TSharedPtr< STouchInterface > LayoutWidget, ULocalPlayer *LocalPlayer, TSharedPtr< SLayoutComponent > InParent=nullptr)
Definition LayoutComponent.cpp:98
bool AllowSizeModification() const
Definition LayoutComponent.h:121
EditAnywhere
Definition LayoutComponent.h:506
bool CanRecenter() const
Definition LayoutComponent.h:437
TSharedPtr< STouchInterface > TouchInterfaceWidget
Definition LayoutComponent.h:655
BlueprintPure bool ContainDecorator(UObject *LayerObject)
Definition LayoutComponent.cpp:1489
BlueprintCallable void SetOpacity(const float Value)
Definition LayoutComponent.h:416
EInteractionType GetInteractionShape() const
Definition LayoutComponent.h:441
FVector2D GetOffsetFromCenter() const
Definition LayoutComponent.h:439
BlueprintReadOnly uint8 bOptimizeRendering
Definition LayoutComponent.h:573
BlueprintPure UBlurLayer * GetDecoratorAsBlur(const FName LayerName)
Definition LayoutComponent.cpp:1444
BlueprintCallable FVector2D GetAlignment() const
Definition LayoutComponent.h:161
TSharedPtr< STouchInterface > GetTouchInterfaceWidget() const
Definition LayoutComponent.h:125
BlueprintCallable int32 GetInputPriority() const
Definition LayoutComponent.h:449
BlueprintReadOnly FVector2D MaxSizeScale
Definition LayoutComponent.h:591
BlueprintReadOnly uint8 bRecenterOnTouch
Definition LayoutComponent.h:597
bool AllowPositionModification() const
Definition LayoutComponent.h:119
TArray< TObjectPtr< UComponentDecorator > > Decorators
Definition LayoutComponent.h:557
BlueprintPure TArray< FName > GetAllDecoratorNames(bool bRecursive)
Definition LayoutComponent.cpp:1411
BlueprintPure float GetComponentAngle() const
Definition LayoutComponent.h:203
void SetComponentOffset(const FVector2D InCenterOffset)
Definition LayoutComponent.h:111
BlueprintCallable void SetConsumeInput(const bool Value)
Definition LayoutComponent.h:473
BlueprintPure float GetInteractionSize() const
Definition LayoutComponent.h:445
BlueprintPure UProgressBarLayer * GetDecoratorAsProgressBar(const FName LayerName)
Definition LayoutComponent.cpp:1434
BlueprintReadOnly FVector4f MaxCenterOffset
Definition LayoutComponent.h:583
BlueprintPure bool ContainDecoratorName(const FName Name, bool bRecursive=false)
Definition LayoutComponent.cpp:1464
FVector2D TopLeftLocation
Definition LayoutComponent.h:673
BlueprintPure UComponentDecorator * GetDecoratorByName(const FName Name, bool bRecursive)
Definition LayoutComponent.cpp:1333
TSharedPtr< SLayoutComponent > ComponentWidget
Definition LayoutComponent.h:653
BlueprintPure UComponentDecoratorGroup * GetDecoratorAsGroup(const FName LayerName)
Definition LayoutComponent.cpp:1454
BlueprintCallable FAnchors GetAnchor() const
Definition LayoutComponent.h:158
BlueprintReadOnly uint8 bConsumeInput
Definition LayoutComponent.h:626
BlueprintPure bool ContainDecoratorClass(TSubclassOf< UComponentDecorator > Class)
Definition LayoutComponent.cpp:1502
BlueprintPure FVector4f GetAnchorOffset() const
Definition LayoutComponent.h:164
UTextureRenderTarget2D * GetCollapsedLayer()
Definition LayoutComponent.cpp:1637
BlueprintPure FVector2D GetComponentSizeScale() const
Definition LayoutComponent.h:215
BlueprintPure UFlipbookLayer * GetDecoratorAsFlipbook(const FName LayerName)
Definition LayoutComponent.cpp:1449
BlueprintReadOnly bool bAllowLocationModification
Definition LayoutComponent.h:578
BlueprintReadWrite EInteractionType InteractionShape
Definition LayoutComponent.h:601
virtual BlueprintPure FVector4f GetComponentMaxOffset() const
Definition LayoutComponent.h:211
virtual TSharedPtr< SLayoutComponent > GetWidgetInstance() const
Definition LayoutComponent.h:123
BlueprintReadOnly uint8 bIsVisible
Definition LayoutComponent.h:566
BlueprintPure UComponentDecorator * GetDecoratorByIndex(const int32 Index)
Definition LayoutComponent.cpp:1362
bool ConsumeInput() const
Definition LayoutComponent.h:436
BlueprintPure UWidgetLayer * GetDecoratorAsWidget(const FName LayerName)
Definition LayoutComponent.cpp:1459
FVector2D LayoutModifierOffset
Definition LayoutComponent.h:647
Category
Definition LayoutComponent.h:157
BlueprintReadOnly uint8 bAllowSizeModification
Definition LayoutComponent.h:586
BlueprintCallable bool IsConsumeInput() const
Definition LayoutComponent.h:453
Instanced TObjectPtr< UComponentLogic > Logic
Definition LayoutComponent.h:638
FVector2D DesignSize
Definition LayoutComponent.h:550
TObjectPtr< UComponentLogic > LogicCompInstance
Definition LayoutComponent.h:659
BlueprintCallable float GetOpacity() const
Definition LayoutComponent.h:412
ULayoutComponent()
Definition LayoutComponent.cpp:24
BlueprintPure TArray< UComponentDecorator * > GetAllDecorators(bool bRecursive)
Definition LayoutComponent.cpp:1388
FVector2D DesignLocation
Definition LayoutComponent.h:534
virtual void BeginDestroy() override
Definition LayoutComponent.cpp:78
Definition LayoutGroupComponent.h:14
Definition ProgressBarLayer.h:48
Definition TextLayer.h:14
Definition TouchInterfaceLayout.h:20
Definition WidgetLayer.h:11
EditAnywhere
Definition LayoutComponent.h:53
BlueprintReadWrite FVector2D Position
Definition LayoutComponent.h:57
BlueprintReadWrite EInteractionType Shape
Definition LayoutComponent.h:54
FHitBox()
Definition LayoutComponent.h:62
BlueprintReadWrite FVector2D Size
Definition LayoutComponent.h:60
Category
Definition LayoutComponent.h:53