MonoGameUi.Control.OnDrawBackground C# (CSharp) Method

OnDrawBackground() protected method

Malt den Hintergrund des Controls
protected OnDrawBackground ( SpriteBatch batch, Rectangle backgroundArea, GameTime gameTime, float alpha ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
backgroundArea Microsoft.Xna.Framework.Rectangle Bereich für den Background in absoluten Koordinaten
gameTime Microsoft.Xna.Framework.GameTime GameTime
alpha float Die Transparenz des Controls.
return void
        protected virtual void OnDrawBackground(SpriteBatch batch, Rectangle backgroundArea, GameTime gameTime, float alpha)
        {
            // Standard Background zeichnen
            if (Pressed && PressedBackground != null)
                PressedBackground.Draw(batch, backgroundArea, alpha);
            else if (Hovered != TreeState.None && HoveredBackground != null)
                HoveredBackground.Draw(batch, backgroundArea, alpha);
            else if (Background != null)
                Background.Draw(batch, backgroundArea, alpha);
        }