Touch Interface Designer 2025.2
Create touch interface with a visual editor and manage all mobile inputs like gestures
Loading...
Searching...
No Matches
SFlipbookLayer.h
Go to the documentation of this file.
1// Copyright 2025 Lost in Game Studio. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Widgets/SLeafWidget.h"
7
8class UMaterialInterface;
9class UTexture2DArray;
10
11class TOUCHINTERFACE_API SFlipbookLayer : public SLeafWidget
12{
13public:
15 : _Material(nullptr)
16 , _FlipbookImages(nullptr)
17 , _Grid(FVector2D(2,2))
18 , _Speed(30.0f)
19 , _AnimationPhase(0.0f)
20 , _AutoAnimate(true)
21 , _FlipbookOpacity(1.0f)
22 {}
23 SLATE_ARGUMENT(FSlateBrush, Flipbook)
24 SLATE_ARGUMENT(TObjectPtr<UMaterialInterface>, Material)
25 SLATE_ARGUMENT(UTexture2DArray*, FlipbookImages)
26 SLATE_ARGUMENT(FVector2D, Grid)
27 SLATE_ARGUMENT(float, Speed)
28 SLATE_ARGUMENT(float, AnimationPhase)
29 SLATE_ARGUMENT(bool, AutoAnimate)
30 SLATE_ARGUMENT(float, FlipbookOpacity)
31
32 SLATE_END_ARGS()
33
35
37 void Construct(const FArguments& InArgs);
38
39 virtual FVector2D ComputeDesiredSize(float LayoutScaleMultiplier) const override;
40
41 virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
42
43 virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
44
45 void SetBrush(const FSlateBrush NewBrush);
46
47 void SetBrushResource(UObject* Resource);
48
49 void SetGrid(const FVector2D GridSize);
50
51 void SetSpeed(const float Value);
52
53 void SetAnimationPhase(const float Value);
54
55 void SetAutoAnimation(const bool bAuto);
56
57 void SetFlipbookOpacity(const float Value);
58
59private:
60 FSlateBrush Flipbook;
61
62 UTexture2DArray* Images;
63
64 FVector2D Grid;
65
66 float Speed;
67
68 float AnimationPhase;
69
70 uint8 bAutoAnimate:1;
71
72 float FlipbookOpacity;
73
74 TArray<FBox2d> UvRegions;
75
76 int32 Index;
77
78 float Counter;
79
80 float WaitDuration;
81};
@ Material
Definition ProgressBarLayer.h:40
Definition SFlipbookLayer.h:12
SLATE_BEGIN_ARGS(SFlipbookLayer)
Definition SFlipbookLayer.h:14
SFlipbookLayer()
Definition SFlipbookLayer.cpp:12