Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmpressBladeDrawer.cs
Go to the documentation of this file.
1
using
Microsoft.Xna.Framework
;
2
using
Terraria.Graphics.Shaders
;
3
4
namespace
Terraria.Graphics
;
5
6
public
struct
EmpressBladeDrawer
7
{
8
public
const
int
TotalIllusions
= 1;
9
10
public
const
int
FramesPerImportantTrail
= 60;
11
12
private
static
VertexStrip
_vertexStrip
=
new
VertexStrip
();
13
14
public
Color
ColorStart
;
15
16
public
Color
ColorEnd
;
17
18
public
void
Draw
(
Projectile
proj)
19
{
20
_ = proj.
ai
[1];
21
MiscShaderData
miscShaderData =
GameShaders
.
Misc
[
"EmpressBlade"
];
22
int
num = 1;
23
int
num2 = 0;
24
int
num3 = 0;
25
float
w = 0.6f;
26
miscShaderData.
UseShaderSpecificData
(
new
Vector4
(num, num2, num3, w));
27
miscShaderData.
Apply
();
28
_vertexStrip
.PrepareStrip(proj.
oldPos
, proj.
oldRot
,
StripColors
,
StripWidth
, -
Main
.
screenPosition
+ proj.
Size
/ 2f, proj.
oldPos
.
Length
, includeBacksides:
true
);
29
_vertexStrip
.DrawTrail();
30
Main
.
pixelShader
.CurrentTechnique.Passes[0].Apply();
31
}
32
33
private
Color
StripColors
(
float
progressOnStrip)
34
{
35
Color
result =
Color
.
Lerp
(
ColorStart
,
ColorEnd
,
Utils
.
GetLerpValue
(0f, 0.7f, progressOnStrip, clamped:
true
)) * (1f -
Utils
.
GetLerpValue
(0f, 0.98f, progressOnStrip, clamped:
true
));
36
result.A /= 2;
37
return
result;
38
}
39
40
private
float
StripWidth
(
float
progressOnStrip)
41
{
42
return
36f;
43
}
44
}
Terraria.Entity.Size
Vector2 Size
Definition
Entity.cs:151
Terraria.Graphics.Shaders.GameShaders.Misc
static Dictionary< string, MiscShaderData > Misc
Definition
GameShaders.cs:11
Terraria.Graphics.Shaders.GameShaders
Definition
GameShaders.cs:6
Terraria.Graphics.Shaders.MiscShaderData.Apply
virtual void Apply(DrawData? drawData=null)
Definition
MiscShaderData.cs:36
Terraria.Graphics.Shaders.MiscShaderData.UseShaderSpecificData
MiscShaderData UseShaderSpecificData(Vector4 specificData)
Definition
MiscShaderData.cs:171
Terraria.Graphics.Shaders.MiscShaderData
Definition
MiscShaderData.cs:10
Terraria.Graphics.VertexStrip
Definition
VertexStrip.cs:9
Terraria.Main.pixelShader
static Effect pixelShader
Definition
Main.cs:2764
Terraria.Main.screenPosition
static Vector2 screenPosition
Definition
Main.cs:1715
Terraria.Main
Definition
Main.cs:79
Terraria.Projectile.oldRot
float[] oldRot
Definition
Projectile.cs:170
Terraria.Projectile.ai
float[] ai
Definition
Projectile.cs:118
Terraria.Projectile.oldPos
Vector2[] oldPos
Definition
Projectile.cs:168
Terraria.Projectile
Definition
Projectile.cs:31
Terraria.Utils.GetLerpValue
static float GetLerpValue(float from, float to, float t, bool clamped=false)
Definition
Utils.cs:203
Terraria.Utils
Definition
Utils.cs:29
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
Terraria.Graphics.Shaders
Definition
ArmorShaderData.cs:6
Terraria.Graphics
Definition
CameraInfo.cs:3
Microsoft.Xna.Framework.Color.Lerp
static Color Lerp(Color value1, Color value2, float amount)
Definition
Color.cs:491
Microsoft.Xna.Framework.Color
Definition
Color.cs:12
Microsoft.Xna.Framework.Vector2.Length
float Length()
Definition
Vector2.cs:80
Microsoft.Xna.Framework.Vector4
Definition
Vector4.cs:12
Terraria.Graphics.EmpressBladeDrawer._vertexStrip
static VertexStrip _vertexStrip
Definition
EmpressBladeDrawer.cs:12
Terraria.Graphics.EmpressBladeDrawer.ColorStart
Color ColorStart
Definition
EmpressBladeDrawer.cs:14
Terraria.Graphics.EmpressBladeDrawer.FramesPerImportantTrail
const int FramesPerImportantTrail
Definition
EmpressBladeDrawer.cs:10
Terraria.Graphics.EmpressBladeDrawer.StripWidth
float StripWidth(float progressOnStrip)
Definition
EmpressBladeDrawer.cs:40
Terraria.Graphics.EmpressBladeDrawer.ColorEnd
Color ColorEnd
Definition
EmpressBladeDrawer.cs:16
Terraria.Graphics.EmpressBladeDrawer.TotalIllusions
const int TotalIllusions
Definition
EmpressBladeDrawer.cs:8
Terraria.Graphics.EmpressBladeDrawer.StripColors
Color StripColors(float progressOnStrip)
Definition
EmpressBladeDrawer.cs:33
Terraria.Graphics.EmpressBladeDrawer.Draw
void Draw(Projectile proj)
Definition
EmpressBladeDrawer.cs:18
Terraria.Graphics.EmpressBladeDrawer
Definition
EmpressBladeDrawer.cs:7
source
Terraria.Graphics
EmpressBladeDrawer.cs
Generated by
1.10.0