Esempio n. 1
0
 internal void Draw(SpriteBatch sb)
 {
     sb.Draw(Game1.WhiteTex, position, Color.DarkGray);
     if (portrait != null)
     {
         portrait.Draw(sb, position);
     }
     else
     {
     }
 }
Esempio n. 2
0
 public override void Draw(SpriteBatch spriteBatch, Color sColor = default(Color), int index = -1, bool waterDraw = false)
 {
     if (bIsLightOn || !bIsLightOn && lightOffAnim == default(ShapeAnimation))
     {
         base.Draw(spriteBatch, sColor, index, waterDraw);
     }
     else
     {
         lightOffAnim.Draw(spriteBatch, this);
     }
 }
        static public void Draw(SpriteBatch sb)
        {
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, cameraMatrix);


            sa.Draw(sb, new Rectangle(0, 0, hitboxWidth * scale, hitboxHeight * scale));
            onScreenBoxes.ForEach(r => sb.Draw(Game1.hitboxHelp, r, Color.White));

            Vector2 trueMousePos = Mouse.GetState().Position.ToVector2();

            trueMousePos -= cameraPosition.ToVector2();
            sb.Draw(Game1.hitboxHelp, new Rectangle((int)trueMousePos.X, (int)trueMousePos.Y, widthHB * scale, heightHB * scale), Game1.hitboxHelp.Bounds, Color.White);
            if (hitboxHeight > 64)
            {
                sb.Draw(Game1.hitboxHelp, new Rectangle(0, hitboxHeight * scale - 64 * scale, hitboxWidth * scale, (64 - 0) * scale), Color.Red);
            }

            sb.End();
            //bIsRunning = false;
        }
        public override void Draw(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(UIElementRender);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            switch (currentState)
            {
            case ButtonState.NON_CLICKED:
                if (ButtonAnim_RestState == null)
                {
                    ButtonAnim_RestState = new ShapeAnimation();
                }
                ButtonAnim_RestState.Draw(sb, new Rectangle(Point.Zero, size));
                break;

            case ButtonState.CLICKED:
                if (ButtonAnim_ClickState == null)
                {
                    ButtonAnim_ClickState = new ShapeAnimation();
                }
                ButtonAnim_ClickState.Draw(sb, new Rectangle(Point.Zero, size));
                break;

            case ButtonState.HOVER:
                if (ButtonAnim_HoverState == null)
                {
                    ButtonAnim_HoverState = new ShapeAnimation();
                }
                ButtonAnim_HoverState.Draw(sb, new Rectangle(Point.Zero, size));
                break;

            default:
                break;
            }

            sb.End();
            sb.GraphicsDevice.SetRenderTarget(null);
        }
Esempio n. 5
0
 internal void Draw(SpriteBatch sb)
 {
     anim.Draw(sb, loc, 1.0f, SpriteEffects.None, Color.White);
     //sb.Draw(arrowTexSheet, new Rectangle(192,1171,64,64),Color.Red);
 }
Esempio n. 6
0
        public void Draw(SpriteBatch sb, RenderTarget2D target = null)
        {
            if (OptionsMenu.bIsRunning)
            {
                sb.End();
                sb.GraphicsDevice.SetRenderTarget(r2d);
                sb.GraphicsDevice.Clear(Color.TransparentBlack);
                sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);
                bg.Draw(sb, new Rectangle(0, 0, 1366, 768));
                sb.End();
                OptionsMenu.Draw(sb, r2d);
                return;
            }
            #region Generate Renders
            switch (currentScreen)
            {
            case Screens.start:
                break;

            case Screens.load:
                if (lgs != null)
                {
                    lgs.GenerateRenders(sb);
                }
                break;

            default:
                break;
            }
            #endregion
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(r2d);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            switch (currentScreen)
            {
            case Screens.start:
                #region
                switch (currentStartScreen)
                {
                case StartScreens.main:
                    DrawMain(sb);
                    break;

                case StartScreens.load:
                    break;

                case StartScreens.loading:
                    DrawLoadScreen(sb, target);
                    break;

                default:
                    break;
                }
                #endregion
                break;

            case Screens.load:
                #region
                if (lgs != null)
                {
                    bg.Draw(sb, new Rectangle(0, 0, 1366, 768));

                    if (loadGameDataTimer != null)
                    {
                        sb.Draw(lgs.getRender(), new Rectangle(0, 0, 1366, 768), Color.White * (loadGameDataTimer.percentageDone()));
                    }
                    else
                    {
                        sb.Draw(lgs.getRender(), new Rectangle(0, 0, 1366, 768), Color.White);
                    }
                }
                #endregion
                break;

            default:
                break;
            }


            sb.End();
            sb.GraphicsDevice.SetRenderTarget(target);
        }