当前位置: 首页>>代码示例>>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;未经允许,请勿转载。