MonoGameUi.Checkbox.OnDrawContent C# (CSharp) Method

OnDrawContent() protected method

Malt den Content des Controls.
protected OnDrawContent ( SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha ) : void
batch SpriteBatch Spritebatch
contentArea Rectangle Bereich für den Content in absoluten Koordinaten
gameTime GameTime GameTime
alpha float Die Transparenz des Controls.
return void
        protected override void OnDrawContent(SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha)
        {
            int innerDistanceX = contentArea.Width / 18;
            int innerDistanceY = contentArea.Height / 18;

            int hookDistanceX = contentArea.Height / 7;
            int hookDistanceY = contentArea.Width / 7;

            BoxBrush.Draw(batch, contentArea, alpha);
            InnerBoxBrush.Draw(batch, new Rectangle(contentArea.X + innerDistanceX, contentArea.Y + innerDistanceY,
                contentArea.Width - innerDistanceX * 2, contentArea.Height - innerDistanceY * 2), alpha);
            if (Checked)
                HookBrush.Draw(batch, new Rectangle(contentArea.X + hookDistanceX, contentArea.Y + +hookDistanceY,
                    contentArea.Width - hookDistanceX * 2, contentArea.Height - hookDistanceY * 2), alpha);
        }