This repository was archived by the owner on Jul 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMobileMenuControls.uc
More file actions
158 lines (139 loc) · 3.27 KB
/
Copy pathMobileMenuControls.uc
File metadata and controls
158 lines (139 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/**
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
*/
class MobileMenuControls extends MobileMenuScene;
var float FadeTime, FadeDuration;
var float AnimTime;
var bool bFadeOut;
var bool bAnimate;
var MobileMenuImage Icon;
var MobileMenuImage Msg;
var float Scale;
function FadeOut()
{
FadeTime = 0;
FadeDuration = 0.5;
bFadeOut = true;
}
function Setup(bool bTap)
{
Icon = MobileMenuImage(MenuObjects[0]);
Msg = MobileMenuImage(MenuObjects[1]);
Scale = Width / 960;
FadeTime = 0;
FadeDuration = 0.5;
bFadeOut = false;
if (bTap)
{
bAnimate = true;
Icon.Width = 84 * Scale;
Icon.Height = 84 * Scale;
Icon.Left = (Width * 0.5) - (Icon.Width * 0.5);
Icon.Top = Height * 0.50;
Icon.ImageUVs.U = 1306;
Icon.ImageUVs.V = 634;
Icon.ImageUVs.UL = 168;
Icon.ImageUVs.VL = 168;
Msg.Width = 373 * Scale;
Msg.Height = 59 * Scale;
Msg.Left = Width * 0.5 - Msg.Width * 0.5;
Msg.Top = Height - Msg.Height * 2;
Msg.ImageUVs.U = 1076;
Msg.ImageUVs.V = 1836;
Msg.ImageUVs.UL = 746;
Msg.ImageUVs.VL = 118;
}
else
{
bAnimate = false;
Icon.Width = 586 * Scale;
Icon.Height = 133 * Scale;
Icon.Left = (Width * 0.5) - (Icon.Width * 0.5);
Icon.Top = Height * 0.25;
Icon.ImageUVs.U = 492;
Icon.ImageUVs.V = 856;
Icon.ImageUVs.UL = 1172;
Icon.ImageUVs.VL = 266;
Msg.Width = 373 * Scale;
Msg.Height = 59 * Scale;
Msg.Left = (Width * 0.5) - (Msg.Width * 0.5);
Msg.Top = Height - (Msg.Height * 2);
Msg.ImageUVs.U = 256;
Msg.ImageUVs.V = 1836;
Msg.ImageUVs.UL = 746;
Msg.ImageUVs.VL = 118;
}
}
function RenderScene(Canvas Canvas,float RenderDelta)
{
local float alpha;
if (bAnimate)
{
Alpha = 1 - AnimTime/0.75;
AnimTime += RenderDelta;
if (AnimTime > 0.75)
{
AnimTime = 0;
}
Icon.Width = 84 * Scale * (1 + 1-Alpha);
Icon.Height = 84 * Scale * (1 + 1-Alpha);
Icon.Left = (Width * 0.5) - (Icon.Width * 0.5);
Icon.Top = Height * 0.50 - (Icon.Height * 0.5);
Icon.Opacity = Alpha;
}
if (FadeDuration > 0)
{
Opacity = bFadeOut ? FInterpEaseIn(1,0,FadeTime/FadeDuration,2.0) : FInterpEaseOut(0,1,FadeTime/FadeDuration,2.0);
FadeTime += RenderDelta;
if (FadeTime > FadeDuration)
{
FadeDuration = 0;
if (bFadeOut)
{
InputOwner.CloseMenuScene(self);
}
}
}
Super.RenderScene(Canvas,RenderDelta);
}
defaultproperties
{
Left=0
Top=0
Width=1.0
Height=1.0
bRelativeLeft=true
bRelativeTop=true
bRelativeWidth=true
bRelativeHeight=true
Begin Object Class=MobileMenuImage Name=Icon
Tag="Background"
Left=0
Top=0
Width=1
Height=1
bRelativeWidth=true
bRelativeHeight=true
Image=Texture2D'CastleUI.menus.T_CastleMenu2'
ImageDrawStyle=IDS_Stretched
ImageUVs=(bCustomCoords=true,U=0,V=0,UL=1920,VL=1280)
bIsActive=false
End Object
MenuObjects(0)=Icon
Begin Object Class=MobileMenuImage Name=Msg
Tag="Background"
Left=0
Top=0
Width=1
Height=1
bRelativeWidth=true
bRelativeHeight=true
Image=Texture2D'CastleUI.menus.T_CastleMenu2'
ImageDrawStyle=IDS_Stretched
ImageUVs=(bCustomCoords=true,U=0,V=0,UL=1920,VL=1280)
bIsActive=false
End Object
MenuObjects(1)=Msg
bSceneDoesNotRequireInput=true
Opacity=0
}