本文整理汇总了C#中Camera.getVisualCordinates方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.getVisualCordinates方法的具体用法?C# Camera.getVisualCordinates怎么用?C# Camera.getVisualCordinates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.getVisualCordinates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.getVisualCordinates(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, 0);
spriteBatch.Draw(boom, cam.getRectangle(particleStartPosition, scale),
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);
if (timeUntilSmokeTime >= smokeTime)
{
Update(elapsedTime);
foreach (SmokeParticle particle in smokeArray)
{
spriteBatch.Draw(smokeTexture,
cam.getVisualCordinates(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, 0);
}
}
}