Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 |
class TsActionCameraOverlay extends TsCameraAction; var() Material Material; var() Color ColorStart; var() Color ColorEnd; var() float U0; var() float V0; var() float U1; var() float V1; var() float X0; var() float Y0; var() float X1; var() float Y1; var() float Duration; var() float ColorFadeInDuration; var() float ColorFadeOutDuration; var() float ColorEaseIn; var() float ColorEaseOut; var() bool bCinematics; var transient MessageRouter Router; var transient float time; var transient bool bFadeOut; var transient Color ColorCurrent; function bool OnStart() { local float alpha; if (Router == None) { Router = Actor.spawn(class'MessageRouter'); Router.Set(self, class'MessagePostRender', "all"); } resetInterpolation(ColorEaseIn, ColorFadeInDuration, ColorEaseOut); time = 0; bFadeOut = false; if (bFadeOut) alpha = 0; else alpha = 1; ColorCurrent.R = ColorStart.R + (ColorEnd.R - ColorStart.R) * alpha; ColorCurrent.G = ColorStart.G + (ColorEnd.G - ColorStart.G) * alpha; ColorCurrent.B = ColorStart.B + (ColorEnd.B - ColorStart.B) * alpha; ColorCurrent.A = ColorStart.A + (ColorEnd.A - ColorStart.A) * alpha; return true; } event OnDelete() { if (Router != None) Router.Destroy(); } function bool OnTick(float delta) { local float alpha; local bool bFinished; time += delta; if (!bFadeOut && time > Duration - ColorFadeOutDuration) { bFadeOut = true; resetInterpolation(ColorEaseIn, ColorFadeOutDuration, ColorEaseOut); } bFinished = tickInterpolation(delta, alpha); if (bFadeOut) { alpha = 1 - alpha; } ColorCurrent.R = ColorStart.R + (ColorEnd.R - ColorStart.R) * alpha; ColorCurrent.G = ColorStart.G + (ColorEnd.G - ColorStart.G) * alpha; ColorCurrent.B = ColorStart.B + (ColorEnd.B - ColorStart.B) * alpha; ColorCurrent.A = ColorStart.A + (ColorEnd.A - ColorStart.A) * alpha; return time < Duration; } function OnFinish() { Router.Destroy(); Router = None; } function Interrupt() { OnFinish(); } function Message(Message msg) { local MessagePostRender m; local float ClipX, ClipY; local float NewY0, NewY1; m = MessagePostRender(msg); ClipX = m.Canvas.ClipX; ClipY = m.Canvas.ClipY; m.canvas.Style = Actor.ERenderStyle.STY_Alpha; if (bCinematics) { // in cinematic mode, y screen extent is 60% of x NewY0 = 0.2f + (Y0 * 0.6f) - (1.0 / ClipY); NewY1 = NewY0 + ((Y1 - Y0) * 0.6f) + (1.0 / ClipY); } else { NewY0 = Y0; NewY1 = Y1; } // Post Render m.Canvas.CurX = X0 * ClipX; m.Canvas.CurY = NewY0 * ClipY; m.Canvas.DrawColor = ColorCurrent; m.Canvas.DrawTile( Material, (X1 - X0) * ClipX, (NewY1 - NewY0) * ClipY, U0, V0, U1 - U0, V1 - V0 ); } function bool SetDuration(float _duration) { Duration = _duration; return true; } function float GetDuration() { return Duration; } defaultproperties { DName ="Overlay" Track ="Effects" Help ="Renders a material overlay on the camera. The effect persists for the specified duration. X and Y coords range from 0 to 1, U and V coords range from 0 to the texture's width and height." UsesDuration =true Material =texture'engine_res.DefaultTexture' ColorStart =(R=255,G=255,B=255,A=1) ColorEnd =(R=255,G=255,B=255,A=128) U0 =0 V0 =0 U1 =128 V1 =128 X0 =0 Y0 =0 X1 =1 Y1 =1 Duration =5 ColorFadeInDuration =1 ColorFadeOutDuration =1 ColorEaseIn =0 ColorEaseOut =0 bCinematics =true } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |