Paint.GraphicsDisplay.GraphicsDisplay C# (CSharp) Method

GraphicsDisplay() public method

Initializes a new instance of the Paint.GraphicsDisplay class.
public GraphicsDisplay ( Microsoft.Xna.Framework.Graphics.Texture2D graphicsTexture, SpriteBatch spriteBatch, bool highResolution ) : System
graphicsTexture Microsoft.Xna.Framework.Graphics.Texture2D The sprite map - all images we need to render
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Low level rendering class
highResolution bool Is the iPad running in High resolution.
return System
        public GraphicsDisplay(Texture2D graphicsTexture, SpriteBatch spriteBatch, bool highResolution)
        {
            int iconSize;
            int emptySquareOffset;

            if (highResolution)
            {
                iconSize = IconSizeRetina;
                emptySquareOffset = 2;
            }
            else
            {
                iconSize = IconSizeLowResolution;
                emptySquareOffset = 1;
            }

            this.graphicsTexture = graphicsTexture;
            this.spriteBatch = spriteBatch;

            List<Rectangle> imageList = new List<Rectangle>();

            // This is the empty square image for all basic single color drawing
            imageList.Add(new Rectangle(0, 0, 0, 0));

            for (int y = 0; y < SpriteMapIconRows; y++)
            {
                for (int x = 0; x < SpriteMapIconColumns; x++)
                {
                    imageList.Add(new Rectangle(emptySquareOffset + (x * iconSize), y * iconSize, iconSize, iconSize));
                }
            }

            this.imageRectangles = imageList.ToArray();
        }