KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UTextureButton.h
이 파일의 문서화 페이지로 가기
1// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
7#include "UTextureButton.generated.h"
8
9DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnTextureButtonClickedEvent);
10
18UCLASS()
19class ONEPIECE_API UTextureButton : public UUserWidget
20{
21 GENERATED_BODY()
22
23public:
28 UFUNCTION(BlueprintCallable, Category = "TextureButton")
29 void SetButtonTexture(UTexture2D* InTexture);
30
35 UFUNCTION(BlueprintCallable, Category = "TextureButton")
36 void SetSymbolTexture(UTexture2D* InTexture);
37
43 UFUNCTION(BlueprintCallable, Category = "TextureButton")
44 void SetButtonSize(float InWidth, float InHeight);
45
50 UFUNCTION(BlueprintCallable, Category = "TextureButton")
51 void SetButtonEnabled(bool bInEnabled);
52
53protected:
54 virtual void NativePreConstruct() override;
55 virtual void NativeConstruct() override;
56
57private:
58 void ApplyTextures();
59 void ApplySymbolColor(const FLinearColor& Color);
60
61 UFUNCTION()
62 void HandleClicked();
63
64 UFUNCTION()
65 void HandleHovered();
66
67 UFUNCTION()
68 void HandleUnhovered();
69
70 UFUNCTION()
71 void HandlePressed();
72
73 UFUNCTION()
74 void HandleReleased();
75
76public:
78 UPROPERTY(BlueprintAssignable, Category = "Event")
79 FOnTextureButtonClickedEvent OnButtonClickedEvent;
80
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
83 UTexture2D* ButtonTexture = nullptr;
84
86 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
87 UTexture2D* SymbolTexture = nullptr;
88
90 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
91 float ButtonWidth = 100.0f;
92
94 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
95 float ButtonHeight = 100.0f;
96
98 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
99 FLinearColor NormalSymbolColor = FLinearColor::White;
100
102 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
103 FLinearColor HoverSymbolColor = FLinearColor(1.2f, 1.2f, 1.2f, 1.0f);
104
106 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
107 FLinearColor PressSymbolColor = FLinearColor(0.8f, 0.8f, 0.8f, 1.0f);
108
110 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (ExposeOnSpawn = true))
111 FLinearColor DisabledSymbolColor = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f);
112
113private:
114 UPROPERTY(meta = (BindWidget))
115 class UButton* Button_Main;
116
117 UPROPERTY(meta = (BindWidget))
118 class UImage* Image_Symbol;
119
120 bool bEnabled = true;
121};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnTextureButtonClickedEvent)
심플한 텍스쳐 기반 버튼 위젯