本文整理汇总了C#中Camera.convertToVisualCoords方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.convertToVisualCoords方法的具体用法?C# Camera.convertToVisualCoords怎么用?C# Camera.convertToVisualCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.convertToVisualCoords方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
//ritar ut texturen med farten och en färg!
public void Draw(SpriteBatch spriteBatch, Camera camera, Texture2D texture)
{
//spriteBatch.Draw(texture, camera.scaleParticles(position.X, position.Y), Color.White);
//spriteBatch.Draw(texture, camera.convertToVisualCoords(new Vector2(position.X, position.Y)), null, Color.White, 0f, Vector2.Zero, 0.1f, SpriteEffects.None, 0f);//denna skalar om mina partiklar!
spriteBatch.Draw(texture, camera.convertToVisualCoords(position),
null,
Color.White,
0f,
new Vector2(texture.Width, texture.Height)/2, camera.scaleSizeTo(texture.Width, scale*size),
SpriteEffects.None,
0f);//denna skalar om mina partiklar!
//camera.scaleSizeTo(texture.Width,scale)
}
示例2: Draw
public void Draw(SpriteBatch sb, Texture2D texture, float maxAge, Camera camera)
{
sb.Draw(texture,
camera.convertToVisualCoords(position),
null,
Color.White,
0f,
new Vector2(texture.Width, texture.Height) / 2,
camera.scaleSizeTo(texture.Width, scale * size),
SpriteEffects.None,
0f);
//sb.Draw(texture,
// camera.convertToVisualCoords(position),
// null,
// null,
// new Vector2(texture.Width / 2f, texture.Height / 2f),
// rotation,
// camera.scaleSizeTo(texture.Width, size),//storleken på smoke är *3
// Color.White,
// SpriteEffects.None,
// 0);
}
示例3: Draw
public void Draw(SpriteBatch spriteBatch, Camera camera)
{
float scale = camera.Scale(particleSize, _smoke.Width);
Color color = new Color(fade, fade, fade, fade);
spriteBatch.Draw(_smoke, camera.convertToVisualCoords(position, scale), null, color, rotation, randomDirection, scale, SpriteEffects.None, 1f);
}