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

◆ Draw()

virtual void Terraria.UI.UIElement.Draw ( SpriteBatch spriteBatch)
inlinevirtualinherited

Reimplemented in Terraria.GameContent.UI.Elements.UIClothStyleButton, Terraria.GameContent.UI.States.AWorkshopPublishInfoState< TPublishedObjectType >, Terraria.GameContent.UI.States.UIAchievementsMenu, Terraria.GameContent.UI.States.UIBestiaryTest, Terraria.GameContent.UI.States.UICharacterCreation, Terraria.GameContent.UI.States.UICharacterSelect, Terraria.GameContent.UI.States.UICreativePowersMenu, Terraria.GameContent.UI.States.UIEmotesMenu, Terraria.GameContent.UI.States.UIManageControls, Terraria.GameContent.UI.States.UIReportsPage, Terraria.GameContent.UI.States.UIResourcePackInfoMenu, Terraria.GameContent.UI.States.UIResourcePackSelectionMenu, Terraria.GameContent.UI.States.UIWorkshopHub, Terraria.GameContent.UI.States.UIWorkshopSelectResourcePackToPublish, Terraria.GameContent.UI.States.UIWorkshopSelectWorldToPublish, Terraria.GameContent.UI.States.UIWorkshopWorldImport, Terraria.GameContent.UI.States.UIWorldCreation, Terraria.GameContent.UI.States.UIWorldLoad, and Terraria.GameContent.UI.States.UIWorldSelect.

Definition at line 197 of file UIElement.cs.

198 {
201 RasterizerState rasterizerState = spriteBatch.GraphicsDevice.RasterizerState;
202 Rectangle scissorRectangle = spriteBatch.GraphicsDevice.ScissorRectangle;
205 {
206 spriteBatch.End();
208 DrawSelf(spriteBatch);
209 spriteBatch.End();
211 }
212 else
213 {
214 DrawSelf(spriteBatch);
215 }
216 if (overflowHidden)
217 {
218 spriteBatch.End();
220 spriteBatch.GraphicsDevice.ScissorRectangle = clippingRectangle;
221 spriteBatch.GraphicsDevice.RasterizerState = OverflowHiddenRasterizerState;
223 }
224 DrawChildren(spriteBatch);
225 if (overflowHidden)
226 {
227 spriteBatch.End();
228 spriteBatch.GraphicsDevice.ScissorRectangle = scissorRectangle;
229 spriteBatch.GraphicsDevice.RasterizerState = rasterizerState;
230 spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, rasterizerState, null, Main.UIScaleMatrix);
231 }
232 }
static readonly BlendState AlphaBlend
Definition BlendState.cs:36
static readonly SamplerState AnisotropicClamp
static readonly RasterizerState OverflowHiddenRasterizerState
Definition UIElement.cs:73
virtual void DrawSelf(SpriteBatch spriteBatch)
Definition UIElement.cs:154
virtual void DrawChildren(SpriteBatch spriteBatch)
Definition UIElement.cs:158
SamplerState OverrideSamplerState
Definition UIElement.cs:45
Rectangle GetClippingRectangle(SpriteBatch spriteBatch)
Definition UIElement.cs:246

References Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.SamplerState.AnisotropicClamp, Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(), Terraria.UI.UIElement.DrawChildren(), Terraria.UI.UIElement.DrawSelf(), Microsoft.Xna.Framework.Graphics.SpriteBatch.End(), Terraria.UI.UIElement.GetClippingRectangle(), Microsoft.Xna.Framework.Graphics.GraphicsResource.GraphicsDevice, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Terraria.UI.UIElement.OverflowHidden, Terraria.UI.UIElement.OverflowHiddenRasterizerState, Terraria.UI.UIElement.OverrideSamplerState, Microsoft.Xna.Framework.Graphics.GraphicsDevice.RasterizerState, Microsoft.Xna.Framework.Graphics.GraphicsDevice.ScissorRectangle, Terraria.Main.UIScaleMatrix, and Terraria.UI.UIElement.UseImmediateMode.

Referenced by Terraria.UI.UserInterface.Draw(), Terraria.GameContent.UI.Elements.UIList.UIInnerList.DrawChildren(), and Terraria.UI.UIElement.DrawChildren().