Beispiel #1
0
        private void AddTexture2D(string key, Rectangle destination, Color color)
        {
            if (!_textureDict.ContainsKey(key))
            {
                int width  = destination.Width;
                int height = destination.Height;

                Texture2D texture = new Texture2D(GraphicsDevice, width, height);
                StaticTexture2D.FillTexture2D(ref texture, width, height, color);

                _textureDict[key] = new ExTexture2D(texture, destination);
            }
        }
Beispiel #2
0
        private void AddTexture2D(string key, Color color)
        {
            if (!_textureDict.ContainsKey(key))
            {
                int width  = GraphicsDevice.Viewport.Width;
                int height = GraphicsDevice.Viewport.Height;

                Texture2D texture = new Texture2D(GraphicsDevice, width, height);
                StaticTexture2D.FillTexture2D(ref texture, width, height, color);

                _textureDict[key] = new ExTexture2D(texture, new Rectangle(0, 0, width, height));
            }
        }