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


C# Camera.getRectangle方法代碼示例

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


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

示例1: Draw

        internal void Draw(float elapsedTime, SpriteBatch spriteBatch, Camera cam)
        {
            timeUntilSmokeTime += elapsedTime / 1000;

            explosion.Update(elapsedTime);
            shockWaveAnimation.Update(elapsedTime);

            spriteBatch.Draw(shockWave, cam.getViewCordinates(particleStartPosition),
                             shockWave.Bounds, new Color(shockWaveAnimation.Fade, shockWaveAnimation.Fade, shockWaveAnimation.Fade, shockWaveAnimation.Fade),
                             0, new Vector2(shockWave.Bounds.Width / 2, shockWave.Bounds.Height / 2), shockWaveAnimation.getScale(cam, shockWave.Bounds.Width),
                             SpriteEffects.None, 1);

            spriteBatch.Draw(boom, cam.getRectangle(particleStartPosition, (scale/2)),
                 new Rectangle((int)(explosion.TexelWidth * explosion.FrameX), (int)(explosion.TexelHeight * explosion.FrameY), (int)explosion.TexelWidth, (int)explosion.TexelHeight),
                 Color.White, 0, Vector2.Zero, SpriteEffects.None, 1);

            if (timeUntilSmokeTime >= smokeTime)
            {
                Update(elapsedTime);
                foreach (SmokeParticle particle in smokeArray)
                {
                    spriteBatch.Draw(smokeTexture,
                                cam.getViewCordinates(particle.Position),
                                smokeTexture.Bounds, new Color(particle.Fade, particle.Fade, particle.Fade, particle.Fade),
                                particle.Rotation, new Vector2(smokeTexture.Bounds.Width / 2, smokeTexture.Bounds.Height),
                                particle.Size, SpriteEffects.None, 1);
                }
            }
        }
開發者ID:ks222rt,項目名稱:1DV437,代碼行數:29,代碼來源:ExplosionView.cs

示例2: Draw

        internal void Draw(float elapsedTime, SpriteBatch spriteBatch, Camera cam)
        {
            explosion.Update(elapsedTime);

            spriteBatch.Draw(boom, cam.getRectangle(particleStartPosition, (scale / 2)),
                 new Rectangle((int)(explosion.TexelWidth * explosion.FrameX), (int)(explosion.TexelHeight * explosion.FrameY), (int)explosion.TexelWidth, (int)explosion.TexelHeight),
                 Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
        }
開發者ID:ks222rt,項目名稱:1DV437,代碼行數:8,代碼來源:ExplosionView.cs

示例3: Draw

        public void Draw(SpriteBatch sprite, Camera cam, Texture2D splitter)
        {
            Rectangle sparkRectangleTexture = cam.getRectangle(position, radius);

            float visibilty = endVisibility * lifePercent + (1.0f - lifePercent) * startVisibility;
            Color colorVisibilty = new Color(visibilty, visibilty, visibilty, visibilty);

            sprite.Draw(splitter, sparkRectangleTexture, splitter.Bounds, colorVisibilty, rotation,
                        new Vector2(splitter.Bounds.Width / 2, splitter.Bounds.Height / 2), SpriteEffects.None, 0);
        }
開發者ID:ks222rt,項目名稱:1DV437,代碼行數:10,代碼來源:ParticleSplitter.cs


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