Ejemplo n.º 1
0
 public Model3DRenderer(GraphicsDevice _dev, SpriteBatchProxy _sprbtch, Matrix _proj, Matrix _view, Matrix _world)
 {
     Rotation = new Vector3();
     world = _world;
     projection = _proj;
     view = _view;
     graphicDevice = _dev;
     spriteBatch = _sprbtch;
     tmpTarget = new RenderTarget2D(graphicDevice, graphicDevice.Viewport.Width, graphicDevice.Viewport.Height);
     randomizator = new Random((int)System.DateTime.Now.Ticks);
     isActive = false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Affichage du nombre de FPS à l'écran et calcul du nombre d'affichages
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="location"></param>
        public void Draw(SpriteBatchProxy spriteBatch, Vector2 location)
        {
            // On compte un affichage supplémentaire
            _totalFrames++;

            Color color = Color.Green;

            #if !WINDOWS_PHONE
            if (_fps < 40) color = Color.Coral;
            #endif

            if (_fps < 25) color = Color.Red;

            spriteBatch.DrawString(Application.MagicContentManager.Font, string.Format("FPS={0}", _fps), location, color);
        }
Ejemplo n.º 3
0
        public void Draw(SpriteBatchProxy spriteBatch)
        {
            if (_alpha > 0)
            {
                spriteBatch.BeginNoCamera();

                string str = _currentSong.Artist + " - " + _currentSong.Name;
                Vector2 size = Application.MagicContentManager.Font.MeasureString(str);
                Vector2 loc = new Vector2(Resolution.VirtualWidth - size.X - 10, 50);

                var dstMenu = new Rectangle((int)(loc.X - 20), (int)loc.Y - 2 * (int)size.Y / 4, (int)size.X * 3 / 2, (int)size.Y * 2);
                var srcMenu = new Rectangle(0, 0, 127, 32);

                spriteBatch.Draw(Application.MagicContentManager.GetTexture("menu"), dstMenu, srcMenu, Color.White * _alpha, 0f, Vector2.Zero, Microsoft.Xna.Framework.Graphics.SpriteEffects.FlipHorizontally, 1.0f);
                spriteBatch.DrawString(Application.MagicContentManager.Font, str, loc, Color.White * _alpha);

                spriteBatch.End();
            }
        }
Ejemplo n.º 4
0
        public void Draw(SpriteBatchProxy spritebatch)
        {
            if (currentState == STATE.INACTIVE) return;
            Rectangle rect = _dstRect;

            rect.Width = POSITIONS[currentIdx];
            spritebatch.Draw(nullTex, rect, Color.Green);
            rect.Offset(POSITIONS[currentIdx], 0);
            rect.Width = _dstRect.Width - POSITIONS[currentIdx];
            spritebatch.Draw(nullTex, rect, color);
            spritebatch.Draw(barcodeTex, _dstRect, Color.White);
            //render number
            Vector2 v = new Vector2(80, 248);
            v += position;
            for (int i = 0; i < BARCODE_LENGTH; i++)
            {
                spritebatch.DrawString(font, barcodeDigits[i].ToString(), v, (i < currentIdx) ? Color.Green : color);
                v.X += 30;
                if (i == 4) v.X += 25;
            }
            if (currentState == STATE.GOOD_ANIM)
            {
                v.Y += 50;
                v.X = _dstRect.X + (_dstRect.Width - font.MeasureString(RANK_TEXT[rank]).X) / 2;
                spritebatch.DrawString(font, RANK_TEXT[rank], v, Color.Pink);
            }
        }
Ejemplo n.º 5
0
 public void DrawFade(SpriteBatchProxy spriteBatch)
 {
     spriteBatch.DrawRectangle(new Rectangle(0, 0, Resolution.VirtualWidth, Resolution.VirtualHeight), _fadingColor * _currentFadeInOut);
 }
Ejemplo n.º 6
0
 public virtual void Draw(SpriteBatchProxy spriteBatch)
 {
     spriteBatch.Draw(Application.MagicContentManager.GetTexture("particules"), Location, src, color * alpha, rotation, particuleOrigin, scale, SpriteEffects.None, 1.0f);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Draw the gris and its element
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatchProxy spriteBatch)
        {
            foreach (Vector2 loc in _grid.Keys)
            {
                Tile tile = _grid[loc];

                if (Application.GameStateManager.CurrentGameState.SceneCamera.VisibilityRectangle.Intersects(tile.DestRect))
                {
                    if (String.IsNullOrEmpty(tile.Spritesheet))
                    {
                        spriteBatch.Draw(Application.MagicContentManager.EmptyTexture, tile.DestRect, tile.SourceRect, Color.Black);
                    }
                    else
                    {
                        spriteBatch.Draw(Application.MagicContentManager.GetTexture(tile.Spritesheet), tile.DestRect, tile.SourceRect, Color.White);
                    }
                }
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Render the game state
 /// </summary>
 /// <param name="spriteBatch"></param>
 public override void Draw(SpriteBatchProxy spriteBatch)
 {
 }
Ejemplo n.º 9
0
 public void Draw(SpriteBatchProxy spriteBatch)
 {
     foreach (Rectangle r in _debug)
     {
         spriteBatch.DrawRectangle(r, Color.Green * 0.75f);
     }
 }