FSO.Client.UI.Framework.UIElement.DrawLocalTexture C# (CSharp) Method

DrawLocalTexture() public method

Draws a texture to the UIElement. This method will deal with the matrix calculations
public DrawLocalTexture ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D texture, Nullable from, Vector2 to, Vector2 scale ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
texture Microsoft.Xna.Framework.Graphics.Texture2D
from Nullable
to Vector2
scale Vector2
return void
        public void DrawLocalTexture(SpriteBatch batch, Texture2D texture, Nullable<Rectangle> from, Vector2 to, Vector2 scale)
        {
            //if (!m_IsInvalidated)
            //{
            batch.Draw(texture, FlooredLocalPoint(to), from, _BlendColor, 0.0f,
                        new Vector2(0.0f, 0.0f), _Scale * scale, SpriteEffects.None, 0.0f);
            //}
        }

Same methods

UIElement::DrawLocalTexture ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D texture, Nullable from, Vector2 to, Vector2 scale, Color blend ) : void
UIElement::DrawLocalTexture ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle from, Vector2 to ) : void
UIElement::DrawLocalTexture ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 to ) : void

Usage Example

Exemplo n.º 1
0
        public void DrawOntoPosition(SpriteBatch SBatch, UIElement element, Texture2D m_Texture, float width, float height, Vector2 position)
        {
            /** TL **/
            element.DrawLocalTexture(SBatch, m_Texture, this.TL, position);

            /** TC **/
            element.DrawLocalTexture(SBatch, m_Texture, this.TC, position + new Vector2(this.Left, 0), this.TC_Scale);

            /** TR **/
            element.DrawLocalTexture(SBatch, m_Texture, this.TR, position + new Vector2(width - this.Right, 0));

            /** ML **/
            element.DrawLocalTexture(SBatch, m_Texture, this.ML, position + new Vector2(0, this.Top), this.ML_Scale);

            /** MC **/
            element.DrawLocalTexture(SBatch, m_Texture, this.MC, position + new Vector2(this.Left, this.Top), this.MC_Scale);

            /** MR **/
            element.DrawLocalTexture(SBatch, m_Texture, this.MR, position + new Vector2(width - this.Right, this.Top), this.MR_Scale);

            /** BL **/
            var bottomY = height - this.Bottom;
            element.DrawLocalTexture(SBatch, m_Texture, this.BL, position + new Vector2(0, bottomY));

            /** BC **/
            element.DrawLocalTexture(SBatch, m_Texture, this.BC, position + new Vector2(this.Left, bottomY), this.BC_Scale);

            /** BR **/
            element.DrawLocalTexture(SBatch, m_Texture, this.BR, position + new Vector2(width - this.Right, bottomY));
        }