예제 #1
0
 /// <summary>
 /// Called every time the screen is to re-draw itself
 /// </summary>
 /// <param name="sb">SpriteBatch for drawing, use sb.draw()</param>
 public override void Draw(FCCSpritebatch sb)
 {
     if (sb != null)
     {
         base.Draw(sb);
     }
 }
예제 #2
0
 /// <summary>
 /// Called every time the screen is to re-draw itself
 /// </summary>
 /// <param name="sb">SpriteBatch for drawing</param>
 public override void DrawGUI(FCCSpritebatch sb)
 {
     base.DrawGUI(sb);
     foreach (var element in this.GUIElements)
     {
         element.Draw(sb);
     }
 }
예제 #3
0
        public void DrawScreen(FCCSpritebatch sb)
        {
            if (sb != null && this.screenBack != null)
            {
                sb.Draw(this.screenBack, Vector2.Zero, Color.White);
            }

            this.Draw(sb);
            this.DrawGUI(sb);
        }
예제 #4
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            ContentController.Instance.Initialize(this.Content, "Content");
            MainGame.GraphicsDev = this.GraphicsDevice;
            this.spriteBatch = new FCCSpritebatch(this.GraphicsDevice);
            AssetCreator.Instance.Initialize(this.GraphicsDevice);
            ScreenManager.Initialize(this.GraphicsDevice);
            ScreenManager.Quit += this.RequestQuit;

            base.Initialize();
        }
예제 #5
0
        public static void Draw(FCCSpritebatch sb)
        {
            if (sb != null)
            {
                if (ScreenManager.activeScreens.Count == 0)
                {
                    sb.SetBandwidth(1f, 0f);
                    sb.Begin(
                        SpriteSortMode.FrontToBack,
                        BlendState.AlphaBlend,
                        SamplerState.LinearClamp,
                        DepthStencilState.Default,
                        RasterizerState.CullCounterClockwise,
                        null,
                        ScreenManager.systemScreens[SystemScreen.MenuScreen].Camera.Transform);

                    ScreenManager.systemScreens[SystemScreen.MenuScreen].DrawScreen(sb);
                    sb.End();
                }
                else
                {
                    for (int i = ScreenManager.activeScreens.Count - popupCount - 1; i < ScreenManager.activeScreens.Count; i++)
                    {
                        var screen = ScreenManager.activeScreens[i];
                        if (screen.IsActive)
                        {
                            if (screen.IsPopup)
                            {
                                sb.SetBandwidth(1f, .8f);
                            }
                            else
                            {
                                sb.SetBandwidth(.79f, 0f);
                            }

                            sb.Begin(
                                SpriteSortMode.FrontToBack,
                                BlendState.AlphaBlend,
                                SamplerState.LinearClamp,
                                DepthStencilState.Default,
                                RasterizerState.CullCounterClockwise,
                                null,
                                screen.Camera.Transform);

                            screen.DrawScreen(sb);
                            sb.End();
                        }
                    }
                }

                sb.End();
            }
        }
예제 #6
0
        /// <summary>
        /// Called every time the screen is to re-draw itself
        /// </summary>
        /// <param name="sb">SpriteBatch for drawing, use sb.draw()</param>
        public override void Draw(FCCSpritebatch sb)
        {
            if (this.showDebugView)
            {
                this.debugView.RenderDebugData(this.debugViewMatrix, Matrix.Identity);
            }
            else
            {
                this.map.Draw(sb);
            }

            base.Draw(sb);
        }
예제 #7
0
        public void Draw(FCCSpritebatch sb)
        {
            if (sb != null)
            {
                var prefade = sb.Fade;
                sb.Fade = this.Fade;
                sb.Draw(this.fill, new Rectangle((int)this.layerBounds[0].X, (int)this.layerBounds[0].Y, this.Width, 1), Color.White);
                sb.Draw(this.fill, new Rectangle((int)this.layerBounds[3].X, (int)this.layerBounds[3].Y, 1, this.Height), Color.White);
                sb.Draw(this.fill, new Rectangle((int)this.layerBounds[3].X, (int)this.layerBounds[3].Y, this.Width, 1), Color.White);
                sb.Draw(this.fill, new Rectangle((int)this.layerBounds[2].X, (int)this.layerBounds[2].Y, 1, this.Height), Color.White);

                this.drawObjects.ForEach(drawObj => drawObj.Draw(sb));
                this.players.ForEach(player => player.Draw(sb));
                sb.Fade = prefade;
            }
        }
예제 #8
0
파일: Map.cs 프로젝트: SDSMTGDT/Physicist
        public void Draw(FCCSpritebatch sb)
        {
            if (sb != null)
            {
                foreach (var layer in this.mapLayers)
                {
                    if (string.Compare(layer.Name, this.ActiveLayer, StringComparison.CurrentCulture) == 0)
                    {
                        layer.Draw(sb);
                    }

                    if (this.transition && string.Compare(layer.Name, this.previouslayer, StringComparison.CurrentCulture) == 0)
                    {
                        layer.Draw(sb);
                    }
                }
            }
        }
예제 #9
0
        public static void Draw(FCCSpritebatch sb)
        {
            if (sb != null)
            {
                if (ScreenManager.activeScreens.Count == 0)
                {
                    sb.SetBandwidth(1f, 0f);
                    sb.Begin(
                        SpriteSortMode.FrontToBack,
                        BlendState.AlphaBlend,
                        SamplerState.LinearClamp,
                        DepthStencilState.Default,
                        RasterizerState.CullCounterClockwise,
                        null,
                        ScreenManager.systemScreens[SystemScreen.MenuScreen].Camera.Transform);

                    ScreenManager.systemScreens[SystemScreen.MenuScreen].Draw(sb);
                    sb.End();
                }
                else
                {
                    for (int i = ScreenManager.activeScreens.Count - popupCount - 1; i < ScreenManager.activeScreens.Count; i++)
                    {
                        var screen = ScreenManager.activeScreens[i];
                        if (screen.IsActive)
                        {
                            if (screen.IsPopup)
                            {
                                sb.SetBandwidth(1f, .8f);
                            }
                            else
                            {
                                sb.SetBandwidth(.79f, 0f);
                            }

                            sb.Begin(
                                SpriteSortMode.FrontToBack,
                                BlendState.AlphaBlend,
                                SamplerState.LinearClamp,
                                DepthStencilState.Default,
                                RasterizerState.CullCounterClockwise,
                                null,
                                screen.Camera.Transform);

                            screen.Draw(sb);
                            sb.End();
                        }
                    }
                }

                sb.End();
            }
        }
예제 #10
0
 public virtual void DrawGUI(FCCSpritebatch sb)
 {
 }