Exemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            const String root = "Sprites01_64";

            images = new Texture2D[2];
            for (int index = 0; index < 2; index++)
            {
                string suffix = String.Empty;
                if (ActionType.Idle != actionType)
                {
                    Direction temp = (Direction)index;
                    suffix = "_" + temp.ToString();
                }
                String assetName = String.Format("{0}/{1}/{2}{3}", root, entityType, actionType, suffix);
                images[index] = Content.Load <Texture2D>(assetName);
            }

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Render target
            PresentationParameters pp = GraphicsDevice.PresentationParameters;
            int width  = pp.BackBufferWidth;
            int height = pp.BackBufferHeight;

            renderTarget = new RenderTarget2D(GraphicsDevice, width, height, 1, GraphicsDevice.DisplayMode.Format);
        }