本文整理汇总了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);
}
}
}
示例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);
}
示例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);
}