當前位置: 首頁>>代碼示例>>C#>>正文


C# SpriteBatch.Start方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.Graphics.SpriteBatch.Start方法的典型用法代碼示例。如果您正苦於以下問題:C# SpriteBatch.Start方法的具體用法?C# SpriteBatch.Start怎麽用?C# SpriteBatch.Start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.Graphics.SpriteBatch的用法示例。


在下文中一共展示了SpriteBatch.Start方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnDraw

 /// <summary>
 ///     Draws the transition
 /// </summary>
 /// <param name="batch">SpriteBatch instance.</param>
 /// <param name="bottom">The pre-rendered scenes.</param>
 /// <param name="top">The scene that is coming.</param>
 protected override void OnDraw(SpriteBatch batch, Texture2D bottom, Texture2D top)
 {
     batch.Start();
     batch.Draw(bottom, Vector2.Zero, Color.White);
     batch.Draw(top, Vector2.Zero, colorOut);
     batch.End();
 }
開發者ID:WoLfulus,項目名稱:Double,代碼行數:13,代碼來源:FadeOutTransition.cs

示例2: OnDraw

 /// <summary>
 /// Scene rendering.
 /// </summary>
 /// <param name="batch">Sprite batch</param>
 protected override void OnDraw(SpriteBatch batch)
 {
     if (!this.fade.IsFinished)
     {
         batch.Start(); 
         batch.DrawString(this.font.Content, "Connecting...", new Vector2(25, 25), Color.White * this.fade.Value);
         batch.End();
     }
 }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:13,代碼來源:Connect.cs

示例3: OnDraw

        /// <summary>
        /// Draws the scene.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            var resources = AlmiranteEngine.Resources;
            var settings = AlmiranteEngine.Settings;

            batch.Start();
            batch.Draw(this.black, new Rectangle(0, 0, settings.Resolution.BaseWidth, settings.Resolution.BaseHeight), Color.White);
            batch.DrawFont(resources.DefaultFont, this.pos, FontAlignment.Left, Color.White, string.Format("Loading resources... {0}", resources.PendingResources));
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:13,代碼來源:LoadingScreen.cs

示例4: OnDraw

        /// <summary>
        /// Screen graphic drawing function.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            base.OnDraw(batch);

            batch.Start(true);
            // batch.Draw(this.texture, Vector2.Zero, Color.White * (down ? 1.0f : 0.5f));
            batch.Draw(this.font.Texture, Vector2.Zero, Color.White);
            batch.DrawFont(this.font, new Vector2(-40, -20), "abcdefghijklmnopqrstuvxyz");
            batch.DrawFont(this.font, new Vector2(-40, -30), "ABCDEFGHIJKLMNOPQRSTUVXYZ");
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:14,代碼來源:MainScene.cs

示例5: OnDraw

        /// <summary>
        /// Screen graphic drawing function.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            base.OnDraw(batch);

            batch.Start(true);
            var background = AlmiranteEngine.Resources.DefaultBackground;
            batch.Draw(background, Vector2.Zero - new Vector2(background.Width / 2, background.Height / 2), Color.White);
            this.entities.Draw();
            batch.End();

            string text = "FPS: {0}\n" +
                          "Camera Position: {1}\n" +
                          "Camera Rotation: {3}\n" +
                          "Camera Zoom: {2}\n";
            var font = AlmiranteEngine.Resources.DefaultFont;

            batch.Start();
            batch.Draw(this.texture, new Rectangle(20, 20, 400, 120), Color.White);
            batch.DrawFont(font, new Vector2(25, 25), Color.White, text, AlmiranteEngine.Time.Fps.ToString(), AlmiranteEngine.Camera.Position, AlmiranteEngine.Camera.Zoom, AlmiranteEngine.Camera.Rotation);
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:24,代碼來源:MainState.cs

示例6: OnDraw

        /// <summary>
        /// Draws the scene.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            var resources = AlmiranteEngine.Resources;

            batch.Start();
            batch.Draw(resources.DefaultBackground, new Vector2(0, 0), Color.White);
            for (int i = 0; i < this.textures.Length; i++)
            {
                if (this.textures[i].Content != null)
                {
                    batch.Draw(this.textures[i].Content, new Vector2(20 + i * 80, 20 + i * 40), Color.White);
                }
            }
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:18,代碼來源:MainScreen.cs

示例7: OnDraw

        /// <summary>
        /// Screen graphic drawing function.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            var input = AlmiranteEngine.Input;
            var resources = AlmiranteEngine.Resources;

            batch.Start();
            batch.Draw(resources.DefaultBackground, new Vector2(0, 0), Color.White);
            batch.DrawFont(resources.DefaultFont, new Vector2(50, 50), FontAlignment.Left, Color.DarkMagenta, string.Format("Mouse: {0}, {1}", input.Mouse.Position.X, input.Mouse.Position.Y));
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:13,代碼來源:MainScreen.cs

示例8: OnDraw

 /// <summary>
 /// Draw
 /// </summary>
 /// <param name="batch"></param>
 protected override void OnDraw(SpriteBatch batch)
 {
     batch.Start();
     batch.Draw(this.overlay, new Rectangle(0, 0, 1280, 720), Color.White * 0.80f); // Background overlay (Black)
     batch.End();
 }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:10,代碼來源:Disconnect.cs

示例9: OnDraw

        /// <summary>
        /// Screen graphic drawing function.
        /// </summary>
        protected override void OnDraw(SpriteBatch batch)
        {
            var input = AlmiranteEngine.Input;
            var resources = AlmiranteEngine.Resources;

            var background = resources.DefaultBackground;

            batch.Start(true);
            batch.Draw(background, Vector2.Zero - new Vector2(background.Width / 2, background.Height / 2), Color.White);
            batch.Draw(dot.Content, Vector2.Zero - new Vector2(dot.Content.Width / 2, dot.Content.Height / 2), Color.White);
            batch.End();

            batch.Start();
            batch.DrawFont(resources.DefaultFont, new Vector2(25, 25), FontAlignment.Left, Color.White, this.strings.ToString());
            batch.DrawFont(resources.DefaultFont, new Vector2(250, 25), FontAlignment.Left, Color.White, string.Format("Mouse wheel: {0}", input.Mouse.ScrollValue));
            batch.DrawFont(resources.DefaultFont, new Vector2(250, 50), FontAlignment.Left, Color.White, string.Format("Mouse position: {0}", input.Mouse.Position));
            batch.DrawFont(resources.DefaultFont, new Vector2(250, 75), FontAlignment.Left, Color.White, string.Format("Mouse world position: {0}", input.Mouse.WorldPosition));
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:22,代碼來源:InputScreen.cs

示例10: OnDraw

        /// <summary>
        /// Draw function
        /// </summary>
        /// <param name="batch"></param>
        protected override void OnDraw(SpriteBatch batch)
        {
            batch.Start();
            batch.Draw(this.background, new Rectangle(0, 0, 1280, 720), Color.White); // Background overlay (Black)
            batch.End();

            // Starts the batch drawing using the camera transformation matrix
            batch.Start(true);
            // Draws a background (map)
            int sx = -1000;
            int sy = -1000;
            for (int x = 0; x < 4; x++)
            {
                sy = -1000;
                for (int y = 0; y < 4; y++)
                {
                    batch.Draw(this.map.Content, new Vector2(sx, sy), Color.White);
                    sy += 500;
                }
                sx += 500;
            }
            // Draws the entities to the screen
            this.entities.Draw();
            // Ends the drawing
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:30,代碼來源:Play.cs

示例11: OnDraw

        /// <summary>
        /// Draws the scene
        /// </summary>
        /// <param name="batch"></param>
        protected override void OnDraw(SpriteBatch batch)
        {
            Rectangle rect;
            rect.X = 0;
            rect.Y = 0;
            rect.Width = AlmiranteEngine.Settings.Resolution.BaseWidth;
            rect.Height = AlmiranteEngine.Settings.Resolution.BaseHeight;

            batch.Start();
            batch.Draw(this.background, rect, Color.White * 0.8f);
            batch.End();
        }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:16,代碼來源:OptionsScene.cs

示例12: OnDraw

 /// <summary>
 /// Screen graphic drawing function.
 /// </summary>
 protected override void OnDraw(SpriteBatch batch)
 {
     var resources = AlmiranteEngine.Resources;
     batch.Start();
     batch.Draw(resources.DefaultBackground, new Vector2(0, 0), Color.White);
     if (this.character.Loaded && this.character.Content != null)
     {
         for (int i = 0; i < this.positions.Length; i++)
         {
             batch.Draw(this.character.Content, this.positions[i], Color.White);
         }
         batch.Draw(this.character.Content, this.position, Color.White);
         batch.Draw(this.character.Content, new Vector2(580, 280), null, this.color, this.angle, new Vector2(this.character.Content.Width / 2, this.character.Content.Height / 2), new Vector2(1, 1), SpriteEffects.None, 0);
     }
     batch.End();
 }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:19,代碼來源:TweenerScreen.cs

示例13: OnDraw

 protected override void OnDraw(SpriteBatch batch)
 {
     batch.Start();
     batch.DrawCircle(new Vector2(640, 360), 20, 48, Color.Red);
     batch.End();
 }
開發者ID:WoLfulus,項目名稱:Double,代碼行數:6,代碼來源:SceneSplash.cs

示例14: OnDraw

 /// <summary>
 /// Draws the scene
 /// </summary>
 /// <param name="batch"></param>
 protected override void OnDraw(SpriteBatch batch)
 {
     batch.Start();
     batch.Draw(AlmiranteEngine.Resources.DefaultBackground, Vector2.Zero, Color.White);
     batch.End();
 }
開發者ID:WoLfulus,項目名稱:Almirante,代碼行數:10,代碼來源:MainScene.cs


注:本文中的Microsoft.Xna.Framework.Graphics.SpriteBatch.Start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。