aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenWelcome.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/screens/UScreenWelcome.pas39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/screens/UScreenWelcome.pas b/src/screens/UScreenWelcome.pas
index 485ebedb..a00a84e2 100644
--- a/src/screens/UScreenWelcome.pas
+++ b/src/screens/UScreenWelcome.pas
@@ -34,7 +34,10 @@ interface
{$I switches.inc}
uses
- UMenu, SDL, SysUtils, UThemes;
+ UMenu,
+ SDL,
+ SysUtils,
+ UThemes;
type
TScreenWelcome = class(TMenu)
@@ -42,24 +45,29 @@ type
Animation: real;
Fadeout: boolean;
constructor Create; override;
- function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
function Draw: boolean; override;
procedure onShow; override;
end;
implementation
-uses UGraphic, UTime, USkins, UTexture;
+uses
+ UGraphic,
+ UTime,
+ USkins,
+ UTexture;
-function TScreenWelcome.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+function TScreenWelcome.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
begin
Result := true;
- If (PressedDown) Then begin
+ if (PressedDown) then
+ begin
case PressedKey of
SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
- Result := False;
+ Result := false;
end;
SDLK_RETURN:
begin
@@ -102,12 +110,14 @@ begin
// draw nothing
Min := 0; Max := 1000;
- if (Animation >= Min) and (Animation < Max) then begin
+ if (Animation >= Min) and (Animation < Max) then
+ begin
end;
// popup
Min := 1000; Max := 1120;
- if (Animation >= Min) and (Animation < Max) then begin
+ if (Animation >= Min) and (Animation < Max) then
+ begin
Factor := (Animation - Min) / (Max - Min);
Static[0].Texture.X := 600;
Static[0].Texture.Y := 600 - Factor * 230;
@@ -117,7 +127,8 @@ begin
// bounce
Min := 1120; Max := 1200;
- if (Animation >= Min) and (Animation < Max) then begin
+ if (Animation >= Min) and (Animation < Max) then
+ begin
Factor := (Animation - Min) / (Max - Min);
Static[0].Texture.Y := 370 + Factor * 50;
Static[0].Texture.H := 230 - Factor * 50;
@@ -125,14 +136,15 @@ begin
// run
Min := 1500; Max := 3500;
- if (Animation >= Min) and (Animation < Max) then begin
+ if (Animation >= Min) and (Animation < Max) then
+ begin
Factor := (Animation - Min) / (Max - Min);
Static[0].Texture.X := 600 - Factor * 1400;
Static[0].Texture.H := 180;
-
- for Count := 1 to 5 do begin
+ for Count := 1 to 5 do
+ begin
Static[Count].Texture.X := 770 - Factor * 1400;
Static[Count].Texture.W := 150 + Factor * 200;
Static[Count].Texture.Alpha := Factor * 0.5;
@@ -140,7 +152,8 @@ begin
end;
Min := 3500;
- if (Animation >= Min) and (not Fadeout) then begin
+ if (Animation >= Min) and (not Fadeout) then
+ begin
FadeTo(@ScreenMain);
Fadeout := true;
end;