TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawMiddleTexture()

void Terraria.ModLoader.SurfaceBackgroundStylesLoader.DrawMiddleTexture ( )
inline

Definition at line 95 of file SurfaceBackgroundStylesLoader.cs.

96 {
97 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
98 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
99 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
100 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
101 //IL_00c9: Unknown result type (might be due to invalid IL or missing references)
102 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
103 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
104 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
105 if (!GlobalBackgroundStyleLoader.loaded || MenuLoader.loading)
106 {
107 return;
108 }
109 foreach (ModSurfaceBackgroundStyle style in list)
110 {
111 int slot = style.Slot;
112 float alpha = Main.bgAlphaFarBackLayer[slot];
113 Main.ColorOfSurfaceBackgroundsModified = Main.ColorOfSurfaceBackgroundsBase * alpha;
114 if (alpha <= 0f)
115 {
116 continue;
117 }
118 int textureSlot = style.ChooseMiddleTexture();
119 if (textureSlot >= 0 && textureSlot < TextureAssets.Background.Length)
120 {
121 Main.instance.LoadBackground(textureSlot);
122 for (int i = 0; i < Main.instance.bgLoops; i++)
123 {
124 Main.spriteBatch.Draw(TextureAssets.Background[textureSlot].Value, new Vector2((float)(Main.instance.bgStartX + Main.bgWidthScaled * i), (float)Main.instance.bgTopY), (Rectangle?)new Rectangle(0, 0, Main.backgroundWidth[textureSlot], Main.backgroundHeight[textureSlot]), Main.ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), Main.bgScale, (SpriteEffects)0, 0f);
125 }
126 }
127 }
128 }
static Asset< Texture2D >[] Background

References Terraria.GameContent.TextureAssets.Background, Terraria.Main.backgroundHeight, Terraria.Main.backgroundWidth, Terraria.Main.bgAlphaFarBackLayer, Terraria.Main.bgScale, Terraria.Main.bgWidthScaled, Terraria.ModLoader.ModSurfaceBackgroundStyle.ChooseMiddleTexture(), Terraria.Main.ColorOfSurfaceBackgroundsModified, Terraria.Main.instance, Terraria.ModLoader.Loader< ModSceneEffect >.list, Terraria.ModLoader.GlobalBackgroundStyleLoader.loaded, Terraria.ModLoader.MenuLoader.loading, Terraria.ModLoader.ModBackgroundStyle.Slot, and Terraria.Main.spriteBatch.

+ Here is the call graph for this function: