本文整理匯總了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);
}